diff options
author | Takashi Iwai <[email protected]> | 2024-09-20 12:32:19 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <[email protected]> | 2024-10-13 18:17:35 +0200 |
commit | 02ac3a9ef3a18b58d8f3ea2b6e46de657bf6c4f9 (patch) | |
tree | d371bcba62de97db769fe1df0671b3cc2c72eeb9 /lib/memory-notifier-error-inject.c | |
parent | 7528cb0f65d7472c1d6b96956f86b408c5ab6b11 (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: [email protected]
Signed-off-by: Takashi Iwai <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'lib/memory-notifier-error-inject.c')
0 files changed, 0 insertions, 0 deletions