public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] ldbl-128ibm-compat: set PRINTF_CHK flag in {,v}sprintf_chk
@ 2020-02-10 23:11 Paul E.Murphy
0 siblings, 0 replies; only message in thread
From: Paul E.Murphy @ 2020-02-10 23:11 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=cd7965bd970b0a298e734acc9dafae0a5db5f712
commit cd7965bd970b0a298e734acc9dafae0a5db5f712
Author: Paul E. Murphy <murphyp@linux.vnet.ibm.com>
Date: Tue Feb 4 09:21:19 2020 -0600
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>
Diff:
---
sysdeps/ieee754/ldbl-128ibm-compat/ieee128-sprintf_chk.c | 4 ++++
sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vsprintf_chk.c | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-sprintf_chk.c b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-sprintf_chk.c
index 207c1c6..f52e17f 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 2c32735..c6130b4 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 ();
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-02-10 23:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-10 23:11 [glibc] ldbl-128ibm-compat: set PRINTF_CHK flag in {,v}sprintf_chk Paul E.Murphy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).