Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:test_hexdump_overflow

Proto:static void __init test_hexdump_overflow(size_t buflen, size_t len, int rowsize, int groupsize, bool ascii)

Type:void

Parameter:

TypeParameterName
size_tbuflen
size_tlen
introwsize
intgroupsize
boolascii
166  rs = rowsize , gs = groupsize
170  total_tests++
172  memset(buf, FILL_CHAR, size of buf )
174  r = hex_dump_to_buffer - convert a blob of data to "hex ASCII" in memory*@buf: data blob to dump*@len: number of bytes in the @buf*@rowsize: number of bytes to print per line; must be 16 or 32*@groupsize: number of bytes to print at a time (1, 2, 4, 8;
180  ae = rs * 2 + rs / gs + 1 + len
181  he = ( gs * 2 + 1) * len / gs - 1
183  If ascii Then e = ae
185  Else e = he
188  f = min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(int, e + 1, buflen)
189  If buflen Then
190  test_hexdump_prepare_test(len, rs, gs, test, size of test , ascii)
191  test[f - 1] = '\0'
193  memset(test + f, FILL_CHAR, size of test - f)
195  a = r == e && Not memcmp(test, buf, TEST_HEXDUMP_BUF_SIZE)
197  buf[ size of buf - 1] = '\0'
199  If Not a Then
200  pr_err("Len: %zu buflen: %zu strlen: %zu\n", len, buflen, strnlen(buf, size of buf ))
202  pr_err("Result: %d '%s'\n", r, buf)
203  pr_err("Expect: %d '%s'\n", e, test)
204  failed_tests++
Caller
NameDescribe
test_hexdump_overflow_set