Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: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

Proto:int string_escape_mem(const char *src, size_t isz, char *dst, size_t osz, unsigned int flags, const char *only)

Type:int

Parameter:

TypeParameterName
const char *src
size_tisz
char *dst
size_tosz
unsigned intflags
const char *only
500  p = dst
501  end = p + osz
502  is_dict = only && only
504  When isz-- cycle
505  c = src++
518  If flags & ESCAPE_NP && isprint(c) || is_dict && Not strchr(only, c) Then Else
522  If flags & ESCAPE_SPACE && escape_space(c, & p, end) Then Continue
525  If flags & ESCAPE_SPECIAL && escape_special(c, & p, end) Then Continue
528  If flags & ESCAPE_NULL && escape_null(c, & p, end) Then Continue
532  If flags & ESCAPE_OCTAL && escape_octal(c, & p, end) Then Continue
535  If flags & ESCAPE_HEX && escape_hex(c, & p, end) Then Continue
539  escape_passthrough(c, & p, end)
542  Return p - dst
Caller
NameDescribe
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