From patchwork Tue Feb 4 15:24:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. Murphy" X-Patchwork-Id: 37673 X-Patchwork-Delegate: tuliom@linux.vnet.ibm.com Received: (qmail 31492 invoked by alias); 4 Feb 2020 15:26:26 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 31410 invoked by uid 89); 4 Feb 2020 15:26:25 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 spammy=3010, HContent-Transfer-Encoding:8bit X-HELO: mx0a-001b2d01.pphosted.com From: "Paul E. Murphy" To: libc-alpha@sourceware.org Subject: [PATCH] ldbl-128ibm-compat: set PRINTF_CHK flag in {,v}sprintf_chk Date: Tue, 4 Feb 2020 09:24:44 -0600 Message-Id: <20200204152444.15633-1-murphyp@linux.vnet.ibm.com> MIME-Version: 1.0 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 --- 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 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 ();