From: H.J. Lu Date: Mon, 27 Apr 2015 16:57:51 +0000 (-0700) Subject: Check tzspec_len == 0 in __tzfile_read X-Git-Tag: glibc-2.22~383 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=5cffc05ed5c7fea312f2822d388afc025d03c08a;p=glibc.git Check tzspec_len == 0 in __tzfile_read [BZ#18333] * time/tzset.c (__tzfile_read): Check tzspec_len == 0. --- diff --git a/ChangeLog b/ChangeLog index 373b12c593..39f74cc542 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-04-27 H.J. Lu + + [BZ#18333] + * time/tzset.c (__tzfile_read): Check tzspec_len == 0. + 2015-04-27 Florian Weimer [BZ#18333] diff --git a/time/tzfile.c b/time/tzfile.c index 46d4fc71ae..57abbb8c14 100644 --- a/time/tzfile.c +++ b/time/tzfile.c @@ -270,7 +270,8 @@ __tzfile_read (const char *file, size_t extra, char **extrap) if (__glibc_unlikely (tzspec_len == 0 || tzspec_len - 1 < num_isgmt)) goto lose; tzspec_len -= num_isgmt + 1; - if (__glibc_unlikely (SIZE_MAX - total_size < tzspec_len)) + if (__glibc_unlikely (tzspec_len == 0 + || SIZE_MAX - total_size < tzspec_len)) goto lose; } if (__glibc_unlikely (SIZE_MAX - total_size - tzspec_len < extra))