about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/x86
diff options
context:
space:
mode:
authorPaul Pluzhnikov <ppluzhnikov@google.com>2018-12-08 10:46:59 -0800
committerPaul Pluzhnikov <ppluzhnikov@google.com>2018-12-08 10:51:36 -0800
commitb93f4052fc171f456c8f594d4ae4aeb02ec5b3b6 (patch)
treecfc74f0a6811da3329a928b007622ae5b10c111f /sysdeps/unix/sysv/linux/x86
parent7c9a7c68363051cfc5fa1ebb96b3b2c1f82dcb76 (diff)
downloadglibc-b93f4052fc171f456c8f594d4ae4aeb02ec5b3b6.tar.gz
glibc-b93f4052fc171f456c8f594d4ae4aeb02ec5b3b6.tar.xz
glibc-b93f4052fc171f456c8f594d4ae4aeb02ec5b3b6.zip
Fix potential stack overflow [BZ #23490]
Since we are expecting the exact "IBT" string, adjust stack buffer size
and scanf format accordingly.
Diffstat (limited to 'sysdeps/unix/sysv/linux/x86')
-rw-r--r--sysdeps/unix/sysv/linux/x86/tst-cet-property-2.c4
1 files changed, 2 insertions, 2 deletions
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)