From patchwork Fri Apr 22 21:12:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 11862 X-Patchwork-Delegate: vapier@gentoo.org Received: (qmail 2843 invoked by alias); 22 Apr 2016 21:12:43 -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 2824 invoked by uid 89); 22 Apr 2016 21:12:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: smtp.gentoo.org From: Mike Frysinger To: libc-alpha@sourceware.org Subject: [PATCH] tst-fmon/tst-numeric: switch malloc to static stack space [BZ #19671] Date: Fri, 22 Apr 2016 17:12:38 -0400 Message-Id: <1461359558-26367-1-git-send-email-vapier@gentoo.org> The current test code doesn't check the return value of malloc. This should rarely (if ever) cause a problem, but rather than add some return value checks, just statically allocate the buffer on the stack. This will never fail (or if it does, we've got much bigger problems that don't matter to the test). Checked that the tests still pass on x86_64-linux-gnu. --- localedata/tst-fmon.c | 2 +- localedata/tst-numeric.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/localedata/tst-fmon.c b/localedata/tst-fmon.c index 995cf90..1359775 100644 --- a/localedata/tst-fmon.c +++ b/localedata/tst-fmon.c @@ -40,7 +40,7 @@ int main (int argc, char *argv[]) { - char *s = malloc (201); + char s[201]; if (setlocale (LC_MONETARY, argv[1]) == NULL) { diff --git a/localedata/tst-numeric.c b/localedata/tst-numeric.c index 46a6b48..ac06965 100644 --- a/localedata/tst-numeric.c +++ b/localedata/tst-numeric.c @@ -41,7 +41,7 @@ int main (int argc, char *argv[]) { - char *s = malloc (201); + char s[201]; double val; /* Make sure to read the value before setting of the locale, as