]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
ldbl-128ibm-compat: set PRINTF_CHK flag in {,v}sprintf_chk
authorPaul E. Murphy <murphyp@linux.vnet.ibm.com>
Tue, 4 Feb 2020 15:21:19 +0000 (09:21 -0600)
committerPaul E. Murphy <murphyp@linux.vnet.ibm.com>
Mon, 10 Feb 2020 22:51:03 +0000 (16:51 -0600)
This should be unconditionally set to match the common implementation,
and fixes multiple test failures related to sprintf.

Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
sysdeps/ieee754/ldbl-128ibm-compat/ieee128-sprintf_chk.c
sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vsprintf_chk.c

index 207c1c62ad0247a86493b333207dda1e24c13fbf..f52e17fdc76ffe83d065d88bbb68ab84c2f40b28 100644 (file)
@@ -30,6 +30,10 @@ ___ieee128_sprintf_chk (char *s, int flag, size_t slen,
   if (flag > 0)
     mode |= PRINTF_FORTIFY;
 
+  /* Regardless of the value of flag, let __vsprintf_internal know that
+     this is a call from *printf_chk.  */
+  mode |= PRINTF_CHK;
+
   if (slen == 0)
     __chk_fail ();
 
index 2c32735f3c2668195a92a0666f5870af156d9802..c6130b4f5f6bc7226cbcf2ec57f02dd38d1ac0c9 100644 (file)
@@ -26,6 +26,10 @@ ___ieee128_vsprintf_chk (char *string, int flag, size_t slen,
   if (flag > 0)
     mode |= PRINTF_FORTIFY;
 
+  /* Regardless of the value of flag, let __vsprintf_internal know that
+     this is a call from *printf_chk.  */
+  mode |= PRINTF_CHK;
+
   if (slen == 0)
     __chk_fail ();