From: Paul Eggert Date: Tue, 18 Sep 2018 22:02:10 +0000 (-0700) Subject: Fix tzfile low-memory assertion failure X-Git-Tag: glibc-2.29~453 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e4e4fde51a309801af5eed72d3494cbf4b7737aa;p=thirdparty%2Fglibc.git Fix tzfile low-memory assertion failure [BZ #21716] * time/tzfile.c (__tzfile_read): Check for memory exhaustion when registering time zone abbreviations. --- diff --git a/ChangeLog b/ChangeLog index 1403616e9a5..5d8c0353906 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2018-09-18 Paul Eggert + + Fix tzfile low-memory assertion failure + [BZ #21716] + * time/tzfile.c (__tzfile_read): Check for memory exhaustion + when registering time zone abbreviations. + 2018-09-18 Joseph Myers * sysdeps/unix/sysv/linux/bits/mman.h: New file. diff --git a/time/tzfile.c b/time/tzfile.c index 2a385b92bcd..ea6e9403039 100644 --- a/time/tzfile.c +++ b/time/tzfile.c @@ -410,7 +410,8 @@ __tzfile_read (const char *file, size_t extra, char **extrap) /* First "register" all timezone names. */ for (i = 0; i < num_types; ++i) - (void) __tzstring (&zone_names[types[i].idx]); + if (__tzstring (&zone_names[types[i].idx]) == NULL) + goto ret_free_transitions; /* Find the standard and daylight time offsets used by the rule file. We choose the offsets in the types of each flavor that are