函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称: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

函数原型:int string_escape_mem(const char *src, size_t isz, char *dst, size_t osz, unsigned int flags, const char *only)

返回类型:int

参数:

类型参数名称
const char *src
size_tisz
char *dst
size_tosz
unsigned intflags
const char *only
500  p等于dst
501  end等于posz
502  is_dict等于onlyonly
504 isz自减循环
505  c等于src自加
518  如果flags按位与ESCAPE_NPisprint(c)或is_dict且非strchr(only, c)则否则
522  如果flags按位与ESCAPE_SPACEescape_space(c, & p, end)则继续下一循环
525  如果flags按位与ESCAPE_SPECIALescape_special(c, & p, end)则继续下一循环
528  如果flags按位与ESCAPE_NULLescape_null(c, & p, end)则继续下一循环
532  如果flags按位与ESCAPE_OCTALescape_octal(c, & p, end)则继续下一循环
535  如果flags按位与ESCAPE_HEXescape_hex(c, & p, end)则继续下一循环
539  escape_passthrough(c, & p, end)
542  返回:pdst
调用者
名称描述
kstrdup_quotableReturn an allocated string that has been escaped of special characters* and double quotes, making it safe to log in quotes.
test_string_escape_overflow
test_string_escape
escaped_string