]> sourceware.org Git - glibc.git/commitdiff
Check tzspec_len == 0 in __tzfile_read
authorH.J. Lu <hjl.tools@gmail.com>
Mon, 27 Apr 2015 16:57:51 +0000 (09:57 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Mon, 27 Apr 2015 16:57:51 +0000 (09:57 -0700)
[BZ#18333]
* time/tzset.c (__tzfile_read): Check tzspec_len == 0.

ChangeLog
time/tzfile.c

index 373b12c593a42ddeb4205affbb4fe15c6d63305c..39f74cc542d26766e692726d9b6aa29233c2aa37 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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]
index 46d4fc71ae4873617b1fdd4d485d25d82f21b0aa..57abbb8c145405e1021f03bdde33fe0ef04c1d32 100644 (file)
@@ -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))
This page took 0.185871 seconds and 5 git commands to generate.