diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2018-09-18 15:02:10 -0700 |
---|---|---|
committer | Andreas K. Hüttel <dilfridge@gentoo.org> | 2018-12-11 23:34:47 +0100 |
commit | 68bdb99cb95e1099b892c90e3195415c93a3f2b3 (patch) | |
tree | 384f524a73b915899b88cc176894b64e4e693b18 | |
parent | [BZ #20271] Add newlines in __libc_fatal calls. (diff) | |
download | glibc-68bdb99cb95e1099b892c90e3195415c93a3f2b3.tar.gz glibc-68bdb99cb95e1099b892c90e3195415c93a3f2b3.tar.bz2 glibc-68bdb99cb95e1099b892c90e3195415c93a3f2b3.zip |
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 e4e4fde51a309801af5eed72d3494cbf4b7737aa)
(cherry picked from commit e7388e5134471ef965bd48bafc71ba71eb8bf017)
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | time/tzfile.c | 3 |
2 files changed, 9 insertions, 1 deletions
@@ -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] diff --git a/time/tzfile.c b/time/tzfile.c index 2a385b92bc..ea6e940303 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 |