]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests/nolibc: check vsnprintf() output buffer before the length
authorDavid Laight <david.laight.linux@gmail.com>
Mon, 2 Mar 2026 10:17:56 +0000 (10:17 +0000)
committerThomas Weißschuh <linux@weissschuh.net>
Fri, 20 Mar 2026 16:46:02 +0000 (17:46 +0100)
commit9aa8a4afd4e6407a4d4521c325855c4467a88b73
treecc1665cf37f15c17eac0fb5588ac122d0540d738
parentb42f02da2bf99460a7b1c5c25008f2e4a65ea4e3
selftests/nolibc: check vsnprintf() output buffer before the length

Check the string matches before checking the returned length.
Only print the string once when it matches.

Makes it a lot easier to diagnose any incorrect output.

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