summaryrefslogtreecommitdiff
path: root/src/time
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2013-11-08 20:50:59 -0500
committerRich Felker <dalias@aerifal.cx>2013-11-08 20:50:59 -0500
commit1d0d2df609b2e47615c7798d1a09e69a2caff24b (patch)
tree6214e755a3080ac06c4947678fb3659c7c2905a1 /src/time
parent8db165258117851e7c5b766ed364e800f18bb40e (diff)
downloadmusl-1d0d2df609b2e47615c7798d1a09e69a2caff24b.tar.gz
musl-1d0d2df609b2e47615c7798d1a09e69a2caff24b.tar.bz2
musl-1d0d2df609b2e47615c7798d1a09e69a2caff24b.tar.xz
musl-1d0d2df609b2e47615c7798d1a09e69a2caff24b.zip
fix handling of overly-long TZ environment variable values
the rest of the code is not prepared to handle an empty TZ string, so falling back to __gmt ("GMT"), just as if TZ had been blank or unset, is the preferable action.
Diffstat (limited to 'src/time')
-rw-r--r--src/time/__tz.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/time/__tz.c b/src/time/__tz.c
index b4358f71..9d56a618 100644
--- a/src/time/__tz.c
+++ b/src/time/__tz.c
@@ -138,7 +138,7 @@ static void do_tzset()
* free so as not to pull it into static programs. Growth
* strategy makes it so free would have minimal benefit anyway. */
i = strlen(s);
- if (i > PATH_MAX+1) s = "", i = 0;
+ if (i > PATH_MAX+1) s = __gmt, i = 3;
if (i >= old_tz_size) {
old_tz_size *= 2;
if (i >= old_tz_size) old_tz_size = i+1;