]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests/nolibc: Check that snprintf() doesn't write beyond the buffer end
authorDavid Laight <david.laight.linux@gmail.com>
Mon, 2 Mar 2026 10:17:58 +0000 (10:17 +0000)
committerThomas Weißschuh <linux@weissschuh.net>
Fri, 20 Mar 2026 16:46:04 +0000 (17:46 +0100)
commit4ea2dedd502e2b4bfa8a47f2aaaaac4eab01e00d
treec497cdf4065c3b67134deafdd589f87cf952417d
parentf36e1ec61a6adb135d1b4021bc849c6acb96f50c
selftests/nolibc: Check that snprintf() doesn't write beyond the buffer end

Fill buf[] with known data and check the vsnprintf() doesn't write
beyond the specified buffer length.

Would have picked up the bug in field padding.

Signed-off-by: David Laight <david.laight.linux@gmail.com>
Acked-by: Willy Tarreau <w@1wt.eu>
Link: https://patch.msgid.link/20260302101815.3043-7-david.laight.linux@gmail.com
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
tools/testing/selftests/nolibc/nolibc-test.c