From patchwork Wed Jan 31 09:55:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Schwab X-Patchwork-Id: 25702 Received: (qmail 31905 invoked by alias); 31 Jan 2018 09:55:49 -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 31895 invoked by uid 89); 31 Jan 2018 09:55:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: mx2.suse.de From: Andreas Schwab To: libc-alpha@sourceware.org Subject: [PATCH] Fix uninitialized variable in assert_perror (bug 22761) X-Yow: Everywhere I look I see NEGATIVITY and ASPHALT... Date: Wed, 31 Jan 2018 10:55:44 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.91 (gnu/linux) MIME-Version: 1.0 I wasn't able to get assert_perror to misbehave in an observable way. [BZ #22761] * assert/assert-perr.c (__assert_perror_fail): Append %n to format string. --- assert/assert-perr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assert/assert-perr.c b/assert/assert-perr.c index 002a5e8708..4b4fe883fd 100644 --- a/assert/assert-perr.c +++ b/assert/assert-perr.c @@ -32,7 +32,7 @@ __assert_perror_fail (int errnum, char errbuf[1024]; char *e = __strerror_r (errnum, errbuf, sizeof errbuf); - __assert_fail_base (_("%s%s%s:%u: %s%sUnexpected error: %s.\n"), + __assert_fail_base (_("%s%s%s:%u: %s%sUnexpected error: %s.\n%n"), e, file, line, function); } libc_hidden_def (__assert_perror_fail)