aboutsummaryrefslogtreecommitdiffstats
path: root/net/unix/unix_bpf.c
diff options
context:
space:
mode:
authorChester Lin <[email protected]>2023-11-07 14:10:44 +0000
committerLinus Walleij <[email protected]>2023-11-14 13:43:37 +0000
commit08e8734d877a9a0fb8af1254a4ce58734fbef296 (patch)
treed7dd4c91dcbd6b0d121922966fe45177654224a4 /net/unix/unix_bpf.c
parentpinctrl: stm32: fix array read out of bound (diff)
downloadkernel-08e8734d877a9a0fb8af1254a4ce58734fbef296.tar.gz
kernel-08e8734d877a9a0fb8af1254a4ce58734fbef296.zip
pinctrl: s32cc: Avoid possible string truncation
With "W=1" and "-Wformat-truncation" build options, the kernel test robot found a possible string truncation warning in pinctrl-s32cc.c, which uses an 8-byte char array to hold a memory region name "map%u". Since the maximum number of digits that a u32 value can present is 10, and the "map" string occupies 3 bytes with a termination '\0', which means the rest 4 bytes cannot fully present the integer "X" that exceeds 4 digits. Here we check if the number >= 10000, which is the lowest value that contains more than 4 digits. Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Signed-off-by: Chester Lin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
Diffstat (limited to 'net/unix/unix_bpf.c')
0 files changed, 0 insertions, 0 deletions