This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Bug in __tzfile_read function


Hello!

I believe there's a bug in __tzfile_read function, fixed by following
patch:

--- glibc-2.7/time/tzfile.c.orig        2007-11-01 11:28:53.717388999 +0000
+++ glibc-2.7/time/tzfile.c     2007-11-01 11:29:33.711287677 +0000
@@ -381,7 +381,7 @@
       else
        tzspec[tzspec_len - 1] = '\0';
     }
-  else if (sizeof (time_t) == 4 && tzhead.tzh_version != '\0')
+  else if (sizeof (time_t) == 4 && tzhead.tzh_version[0] != '\0')
     {
       /* Get the TZ string.  */
       if (__builtin_expect (fread_unlocked ((void *) &tzhead, sizeof (tzhead),

There is no point to check value of tzhead.tzh_version because it's always
differs from 0.

-- 
Szymon Siwek


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]