From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2020) id CC762385840B; Fri, 12 Nov 2021 23:09:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CC762385840B Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Stafford Horne To: glibc-cvs@sourceware.org Subject: [glibc] tst-tzset: output reason when creating 4GiB file fails X-Act-Checkin: glibc X-Git-Author: Stafford Horne X-Git-Refname: refs/heads/master X-Git-Oldrev: d672a98a1af106bd68deb15576710cd61363f7a6 X-Git-Newrev: afbf26492a5adccc4c4eda00eb588b0b79e4290a Message-Id: <20211112230907.CC762385840B@sourceware.org> Date: Fri, 12 Nov 2021 23:09:07 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2021 23:09:07 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=afbf26492a5adccc4c4eda00eb588b0b79e4290a commit afbf26492a5adccc4c4eda00eb588b0b79e4290a Author: Stafford Horne Date: Mon Sep 20 06:03:07 2021 +0900 tst-tzset: output reason when creating 4GiB file fails Currently, if the temporary file creation fails the create_tz_file function returns NULL. The NULL pointer is then passed to setenv which causes a SIGSEGV. Rather than failing with a SIGSEGV print a warning and exit. Diff: --- timezone/tst-tzset.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/timezone/tst-tzset.c b/timezone/tst-tzset.c index d6da2932bb..3dad42e041 100644 --- a/timezone/tst-tzset.c +++ b/timezone/tst-tzset.c @@ -25,6 +25,7 @@ #include #include #include +#include static int do_test (void); #define TEST_FUNCTION do_test () @@ -103,6 +104,13 @@ static void test_tz_file (off64_t size) { char *path = create_tz_file (size); + if (path == NULL) + { + printf ("creating timezone file of size: %" PRId64 "MiB failed.\n", + size / (1024 * 1024)); + exit (1); + } + if (setenv ("TZ", path, 1) < 0) { printf ("setenv failed: %m\n");