about summary refs log tree commit diff
path: root/debug
diff options
context:
space:
mode:
Diffstat (limited to 'debug')
-rw-r--r--debug/sprintf_chk.c4
-rw-r--r--debug/vsprintf_chk.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/debug/sprintf_chk.c b/debug/sprintf_chk.c
index 54d4a64255..7ef01653ee 100644
--- a/debug/sprintf_chk.c
+++ b/debug/sprintf_chk.c
@@ -29,6 +29,10 @@ ___sprintf_chk (char *s, int flag, size_t slen, const char *format, ...)
   va_list ap;
   int ret;
 
+  /* 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/debug/vsprintf_chk.c b/debug/vsprintf_chk.c
index 7ef8cf38bc..c93ca4efb1 100644
--- a/debug/vsprintf_chk.c
+++ b/debug/vsprintf_chk.c
@@ -25,6 +25,10 @@ ___vsprintf_chk (char *s, int flag, size_t slen, const char *format,
      can only come from read-only format strings.  */
   unsigned int mode = (flag > 0) ? PRINTF_FORTIFY : 0;
 
+  /* 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 ();