mirror of git://git.musl-libc.org/musl
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.
This commit is contained in:
parent
8db1652581
commit
1d0d2df609
|
@ -138,7 +138,7 @@ static void do_tzset()
|
||||||
* free so as not to pull it into static programs. Growth
|
* free so as not to pull it into static programs. Growth
|
||||||
* strategy makes it so free would have minimal benefit anyway. */
|
* strategy makes it so free would have minimal benefit anyway. */
|
||||||
i = strlen(s);
|
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) {
|
if (i >= old_tz_size) {
|
||||||
old_tz_size *= 2;
|
old_tz_size *= 2;
|
||||||
if (i >= old_tz_size) old_tz_size = i+1;
|
if (i >= old_tz_size) old_tz_size = i+1;
|
||||||
|
|
Loading…
Reference in New Issue