summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schwab <aschwab@redhat.com>2009-06-23 09:13:30 -0700
committerPetr Baudis <pasky@suse.cz>2009-07-16 17:38:00 +0200
commit3f860e1ac8f14fecf09cf1f42add019e62b55a1d (patch)
tree5acf888043a2a12720a0cb86c5b9e30d28af12cf
parent9210e448bf719e169a60da42866650095e8f5161 (diff)
Handle empty TZ strings at the end of new-style timzeone files correctly.
(cherry picked from commit 7a7c2c24654f7ab69b1cec72c329c8d73f0e4c04)
-rw-r--r--ChangeLog4
-rw-r--r--time/tzfile.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index aff242074e..8d2284aff4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-06-23 Andreas Schwab <aschwab@redhat.com>
+
+ * time/tzfile.c (__tzfile_read): Don't use an empty TZ string.
+
2009-06-18 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/bits/socket.h: Define PF_IEEE802154 and
diff --git a/time/tzfile.c b/time/tzfile.c
index d8bd55a130..f4cba46e50 100644
--- a/time/tzfile.c
+++ b/time/tzfile.c
@@ -419,6 +419,10 @@ __tzfile_read (const char *file, size_t extra, char **extrap)
tzspec = __tzstring (tzstr);
}
+ /* Don't use an empty TZ string. */
+ if (tzspec != NULL && tzspec[0] == '\0')
+ tzspec = NULL;
+
fclose (f);
/* First "register" all timezone names. */