Fix potential stack overflow [BZ #23490]

Since we are expecting the exact "IBT" string, adjust stack buffer size
and scanf format accordingly.
This commit is contained in:
Paul Pluzhnikov 2018-12-08 10:46:59 -08:00
parent 7c9a7c6836
commit b93f4052fc
2 changed files with 8 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2018-12-08 Paul Pluzhnikov <ppluzhnikov@google.com>
[BZ #23490]
* sysdeps/unix/sysv/linux/x86/tst-cet-property-2.c
(do_test): Adjust buffer size and fix format.
2018-12-07 DJ Delorie <dj@redhat.com>
[BZ #23907]

View File

@ -44,9 +44,9 @@ sig_handler (int signo)
static int
do_test (void)
{
char buf[20];
char buf[4];
if (scanf ("%20s", buf) != 1)
if (scanf ("%3s", buf) != 1)
FAIL_UNSUPPORTED ("IBT not supported");
if (strcmp (buf, "IBT") != 0)