aboutsummaryrefslogtreecommitdiff
path: root/rust/helpers/build_bug.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2024-09-20 12:32:19 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-10-13 18:17:35 +0200
commit02ac3a9ef3a18b58d8f3ea2b6e46de657bf6c4f9 (patch)
treed371bcba62de97db769fe1df0671b3cc2c72eeb9 /rust/helpers/build_bug.c
parent7528cb0f65d7472c1d6b96956f86b408c5ab6b11 (diff)
parport: Proper fix for array out-of-bounds access
The recent fix for array out-of-bounds accesses replaced sprintf() calls blindly with snprintf(). However, since snprintf() returns the would-be-printed size, not the actually output size, the length calculation can still go over the given limit. Use scnprintf() instead of snprintf(), which returns the actually output letters, for addressing the potential out-of-bounds access properly. Fixes: ab11dac93d2d ("dev/parport: fix the array out-of-bounds risk") Cc: stable@vger.kernel.org Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20240920103318.19271-1-tiwai@suse.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'rust/helpers/build_bug.c')
0 files changed, 0 insertions, 0 deletions