函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\test-string_helpers.c Create Date:2022-07-27 07:23:19
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:test_string_escape

函数原型:static __init void test_string_escape(const char *name, const struct test_string_2 *s2, unsigned int flags, const char *esc)

返回类型:void

参数:

类型参数名称
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  如果非out_test或非out_real或非in则转到:out
289 in循环
294  如果flags按位与ESCAPE_NULL
295  in[p++]等于'\0'
296  out_test[q_test++]等于'\\'
297  out_test[q_test++]等于'0'
301  out等于test_string_find_match(s2, flags)
302  如果非out则继续下一循环
306  len等于strlen(in)
307  内存复制( & in[p], in, len)
308  p加等于len
311  len等于strlen(out)
312  内存复制( & 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)
调用者
名称描述
test_string_helpers_init