Fix missing NUL terminator in stdio-common/scanf13 test

sscanf is only defined on nul terminated string input, but '\0' was
missing in this test which caused _IO_str_init_static_internal to
read OOB on the stack when computing the bounds of the string.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
This commit is contained in:
Szabolcs Nagy 2022-10-11 14:57:16 +01:00
parent 6a3794ea91
commit b866018f54

View File

@ -67,6 +67,7 @@ main (void)
buf[2049] = 0x84;
buf[2058] = '\t';
buf[2059] = 'a';
buf[sizeof (buf) - 1] = '\0';
if (sscanf (buf, "%ms%mc", &sp1, &sp2) != 2)
FAIL ();
else