bca718
commit 5cffc05ed5c7fea312f2822d388afc025d03c08a
bca718
Author: H.J. Lu <hjl.tools@gmail.com>
bca718
Date:   Mon Apr 27 09:57:51 2015 -0700
bca718
bca718
    Check tzspec_len == 0 in __tzfile_read
bca718
    
bca718
    	[BZ#18333]
bca718
    	* time/tzset.c (__tzfile_read): Check tzspec_len == 0.
bca718
bca718
--- a/time/tzfile.c
bca718
+++ b/time/tzfile.c
bca718
@@ -283,7 +283,8 @@
bca718
       if (__builtin_expect (tzspec_len == 0 || tzspec_len - 1 < num_isgmt, 0))
bca718
 	goto lose;
bca718
       tzspec_len -= num_isgmt + 1;
bca718
-      if (__builtin_expect (SIZE_MAX - total_size < tzspec_len, 0))
bca718
+      if (__builtin_expect (tzspec_len == 0
bca718
+                            || SIZE_MAX - total_size < tzspec_len, 0))
bca718
 	goto lose;
bca718
     }
bca718
   if (__builtin_expect (SIZE_MAX - total_size - tzspec_len < extra, 0))