This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Fix handling of timezone file with empty TZ string
- From: Andreas Schwab <aschwab at redhat dot com>
- To: libc-alpha at sourceware dot org
- Date: Tue, 23 Jun 2009 11:22:02 +0200
- Subject: Fix handling of timezone file with empty TZ string
If a timezone rule cannot be expressed through POSIX rules the TZ string
stored in the timezone file is empty, and __tzfile_compute should not
try to parse it.
Andreas.
2009-06-23 Andreas Schwab <aschwab@redhat.com>
* time/tzfile.c (__tzfile_read): Don't use an empty TZ string.
diff --git a/time/tzfile.c b/time/tzfile.c
index d8bd55a..c4b9fb6 100644
--- a/time/tzfile.c
+++ b/time/tzfile.c
@@ -418,6 +418,9 @@ __tzfile_read (const char *file, size_t extra, char **extrap)
tzstr[tzspec_len - 1] = '\0';
tzspec = __tzstring (tzstr);
}
+ /* Don't use an empty TZ string. */
+ if (tzspec != NULL && tzspec[0] == '\0')
+ tzspec = NULL;
fclose (f);
--
Andreas Schwab, aschwab@redhat.com
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E
"And now for something completely different."