diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2015-04-27 09:57:51 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2015-04-27 09:57:51 -0700 |
commit | 5cffc05ed5c7fea312f2822d388afc025d03c08a (patch) | |
tree | 8de4df3e333f58bda7ad97464436a078397dc91c | |
parent | cc8dcf96e71dd643f929e32150904cd6ad69efa8 (diff) | |
download | glibc-5cffc05ed5c7fea312f2822d388afc025d03c08a.zip glibc-5cffc05ed5c7fea312f2822d388afc025d03c08a.tar.gz glibc-5cffc05ed5c7fea312f2822d388afc025d03c08a.tar.bz2 |
Check tzspec_len == 0 in __tzfile_read
[BZ#18333]
* time/tzset.c (__tzfile_read): Check tzspec_len == 0.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | time/tzfile.c | 3 |
2 files changed, 7 insertions, 1 deletions
@@ -1,3 +1,8 @@ +2015-04-27 H.J. Lu <hongjiu.lu@intel.com> + + [BZ#18333] + * time/tzset.c (__tzfile_read): Check tzspec_len == 0. + 2015-04-27 Florian Weimer <fweimer@redhat.com> [BZ#18333] diff --git a/time/tzfile.c b/time/tzfile.c index 46d4fc7..57abbb8 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)) |