]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix tzfile low-memory assertion failure
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 18 Sep 2018 22:02:10 +0000 (15:02 -0700)
committerCarlos O'Donell <carlos@redhat.com>
Fri, 9 Nov 2018 15:17:13 +0000 (10:17 -0500)
[BZ #21716]
* time/tzfile.c (__tzfile_read): Check for memory exhaustion
when registering time zone abbreviations.

(cherry picked from commit e4e4fde51a309801af5eed72d3494cbf4b7737aa)

ChangeLog
time/tzfile.c

index 5145768a455fed295158e91b8dadb1290b9292cd..788f3f41bec90846fdcff1daf5c6e22a98fac9be 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2018-09-18  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Fix tzfile low-memory assertion failure
+       [BZ #21716]
+       * time/tzfile.c (__tzfile_read): Check for memory exhaustion
+       when registering time zone abbreviations.
+
 2018-08-31  Paul Pluzhnikov  <ppluzhnikov@google.com>
 
        [BZ #20271]
index 2a385b92bcdefec08576a835293ccd10e5572019..ea6e94030392fc754118a6a60feffff0c54a7069 100644 (file)
@@ -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