From b93f4052fc171f456c8f594d4ae4aeb02ec5b3b6 Mon Sep 17 00:00:00 2001 From: Paul Pluzhnikov Date: Sat, 8 Dec 2018 10:46:59 -0800 Subject: Fix potential stack overflow [BZ #23490] Since we are expecting the exact "IBT" string, adjust stack buffer size and scanf format accordingly. --- sysdeps/unix/sysv/linux/x86/tst-cet-property-2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sysdeps/unix/sysv/linux/x86') diff --git a/sysdeps/unix/sysv/linux/x86/tst-cet-property-2.c b/sysdeps/unix/sysv/linux/x86/tst-cet-property-2.c index 0531074ceb..259ef44eb8 100644 --- a/sysdeps/unix/sysv/linux/x86/tst-cet-property-2.c +++ b/sysdeps/unix/sysv/linux/x86/tst-cet-property-2.c @@ -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) -- cgit v1.2.3-70-g09d2