ldbl-128ibm-compat: set PRINTF_CHK flag in {,v}sprintf_chk

Message ID 20200204152444.15633-1-murphyp@linux.vnet.ibm.com
State New
Headers show
Series
  • ldbl-128ibm-compat: set PRINTF_CHK flag in {,v}sprintf_chk
Related show

Commit Message

Paul E. Murphy Feb. 4, 2020, 3:24 p.m.
This should be unconditionally set to match the common implementation,
and fixes multiple test failures related to sprintf.
---
 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(+)

-- 
2.21.1

Comments

Tulio Magno Quites Machado Filho Feb. 10, 2020, 7:55 p.m. | #1
"Paul E. Murphy" <murphyp@linux.vnet.ibm.com> writes:

> 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>


-- 
Tulio Magno
Paul E Murphy Feb. 10, 2020, 11:13 p.m. | #2
Pushed.  Thank you for reviewing.

On 2/10/20 1:55 PM, Tulio Magno Quites Machado Filho wrote:
> "Paul E. Murphy" <murphyp@linux.vnet.ibm.com> writes:

> 

>> 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>

>

Patch

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 ();