Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\test-string_helpers.c Create Date:2022-07-28 06:26:05
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:test_string_escape

Proto:static __init void test_string_escape(const char *name, const struct test_string_2 *s2, unsigned int flags, const char *esc)

Type:void

Parameter:

TypeParameterName
const char *name
const struct test_string_2 *s2
unsigned intflags
const char *esc
279  out_size = 512
280  out_test = kmalloc(out_size, GFP_KERNEL)
281  out_real = kmalloc(out_size, GFP_KERNEL)
282  in = kmalloc(256, GFP_KERNEL)
283  p = 0 , q_test = 0
286  If Not out_test || Not out_real || Not in Then Go to out
289  When in cycle
294  If flags & ESCAPE_NULL Then
295  in[p++] = '\0'
296  out_test[q_test++] = '\\'
297  out_test[q_test++] = '0'
301  out = test_string_find_match(s2, flags)
302  If Not out Then Continue
306  len = strlen(in)
307  No 3D Now!( & in[p], in, len)
308  p += len
311  len = strlen(out)
312  No 3D Now!( & out_test[q_test], out, len)
313  q_test += len
316  q_real = string_escape_mem - quote characters in the given memory buffer*@src: source buffer (unescaped)*@isz: source buffer size*@dst: destination buffer (escaped)*@osz: destination buffer size*@flags: combination of the flags*@only: NULL-terminated string
318  test_string_check_buf(name, flags, in, p, out_real, q_real, out_test, q_test)
321  test_string_escape_overflow(in, p, flags, esc, q_test, name)
323  out :
324  kfree(in)
325  kfree(out_real)
326  kfree(out_test)
Caller
NameDescribe
test_string_helpers_init