Fix tzfile low-memory assertion failure

[BZ #21716]
* time/tzfile.c (__tzfile_read): Check for memory exhaustion
when registering time zone abbreviations.

(cherry picked from commit e4e4fde51a)
This commit is contained in:
Paul Eggert 2018-09-18 15:02:10 -07:00 committed by Carlos O'Donell
parent 9071be6b3f
commit e7388e5134
2 changed files with 9 additions and 1 deletions

View File

@ -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> 2018-08-31 Paul Pluzhnikov <ppluzhnikov@google.com>
[BZ #20271] [BZ #20271]

View File

@ -410,7 +410,8 @@ __tzfile_read (const char *file, size_t extra, char **extrap)
/* First "register" all timezone names. */ /* First "register" all timezone names. */
for (i = 0; i < num_types; ++i) 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. /* Find the standard and daylight time offsets used by the rule file.
We choose the offsets in the types of each flavor that are We choose the offsets in the types of each flavor that are