public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/arm/morello/main] Fix missing NUL terminator in stdio-common/scanf13 test
@ 2022-11-23 14:39 Szabolcs Nagy
  0 siblings, 0 replies; 4+ messages in thread
From: Szabolcs Nagy @ 2022-11-23 14:39 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=69ecb7b4a3287e814d315e0bab05705be4d9a010

commit 69ecb7b4a3287e814d315e0bab05705be4d9a010
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Tue Oct 11 14:57:16 2022 +0100

    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.

Diff:
---
 stdio-common/scanf13.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/stdio-common/scanf13.c b/stdio-common/scanf13.c
index 720224aa05..60aa62a26f 100644
--- a/stdio-common/scanf13.c
+++ b/stdio-common/scanf13.c
@@ -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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [glibc/arm/morello/main] Fix missing NUL terminator in stdio-common/scanf13 test
@ 2022-10-27 13:49 Szabolcs Nagy
  0 siblings, 0 replies; 4+ messages in thread
From: Szabolcs Nagy @ 2022-10-27 13:49 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=b30fd928ac8f272dccb232cea47233c03f8f142d

commit b30fd928ac8f272dccb232cea47233c03f8f142d
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Tue Oct 11 14:57:16 2022 +0100

    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.

Diff:
---
 stdio-common/scanf13.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/stdio-common/scanf13.c b/stdio-common/scanf13.c
index 720224aa05..60aa62a26f 100644
--- a/stdio-common/scanf13.c
+++ b/stdio-common/scanf13.c
@@ -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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [glibc/arm/morello/main] Fix missing NUL terminator in stdio-common/scanf13 test
@ 2022-10-26 15:10 Szabolcs Nagy
  0 siblings, 0 replies; 4+ messages in thread
From: Szabolcs Nagy @ 2022-10-26 15:10 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=a4a231893f5af8a532cfd149dd71253d9183f600

commit a4a231893f5af8a532cfd149dd71253d9183f600
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Tue Oct 11 14:57:16 2022 +0100

    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.

Diff:
---
 stdio-common/scanf13.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/stdio-common/scanf13.c b/stdio-common/scanf13.c
index 720224aa05..60aa62a26f 100644
--- a/stdio-common/scanf13.c
+++ b/stdio-common/scanf13.c
@@ -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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [glibc/arm/morello/main] Fix missing NUL terminator in stdio-common/scanf13 test
@ 2022-10-12 14:15 Szabolcs Nagy
  0 siblings, 0 replies; 4+ messages in thread
From: Szabolcs Nagy @ 2022-10-12 14:15 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=ed157fcccd5dcf2644236084082ebb5159f6cff8

commit ed157fcccd5dcf2644236084082ebb5159f6cff8
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Tue Oct 11 14:57:16 2022 +0100

    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.

Diff:
---
 stdio-common/scanf13.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/stdio-common/scanf13.c b/stdio-common/scanf13.c
index 720224aa05..60aa62a26f 100644
--- a/stdio-common/scanf13.c
+++ b/stdio-common/scanf13.c
@@ -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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-11-23 14:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-23 14:39 [glibc/arm/morello/main] Fix missing NUL terminator in stdio-common/scanf13 test Szabolcs Nagy
  -- strict thread matches above, loose matches on Subject: below --
2022-10-27 13:49 Szabolcs Nagy
2022-10-26 15:10 Szabolcs Nagy
2022-10-12 14:15 Szabolcs Nagy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).