summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul E. Murphy <murphyp@linux.vnet.ibm.com>2020-02-04 09:21:19 -0600
committerPaul E. Murphy <murphyp@linux.vnet.ibm.com>2020-02-10 16:51:03 -0600
commitcd7965bd970b0a298e734acc9dafae0a5db5f712 (patch)
tree6eb1020c7ff5281b12de594bea9cd4cba742628e
parenta179673f3d46e25f2a71c2a8f0c64b6d71ccaa6e (diff)
downloadglibc-cd7965bd970b0a298e734acc9dafae0a5db5f712.tar.gz
ldbl-128ibm-compat: set PRINTF_CHK flag in {,v}sprintf_chk
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>
-rw-r--r--sysdeps/ieee754/ldbl-128ibm-compat/ieee128-sprintf_chk.c4
-rw-r--r--sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vsprintf_chk.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-sprintf_chk.c b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-sprintf_chk.c
index 207c1c62ad..f52e17fdc7 100644
--- a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-sprintf_chk.c
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-sprintf_chk.c
@@ -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 ();
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vsprintf_chk.c b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vsprintf_chk.c
index 2c32735f3c..c6130b4f5f 100644
--- a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vsprintf_chk.c
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vsprintf_chk.c
@@ -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 ();