This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] Bug in __tzfile_read function
- From: Szymon Siwek <sls at poczta dot wp dot pl>
- To: libc-alpha at sourceware dot org
- Date: Sat, 3 Nov 2007 20:54:31 +0100
- Subject: [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