From: Samuel Holland Date: Sat, 22 Feb 2020 22:01:13 +0000 (-0600) Subject: fix parsing offsets after long timezone names X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=33338ebc853d37c80f0f236cc7a92cb0acc6aace;p=oweals%2Fmusl.git fix parsing offsets after long timezone names TZ containg a timezone name with >TZNAME_MAX characters currently breaks musl's timezone parsing. getname() stops after TZNAME_MAX characters. getoff() will consume no characters (because the next character is not a digit) and incorrectly return 0. Then, because there are remaining alphabetic characters, __daylight == 1, and dst_off == -3600. getname() must consume the entire timezone name, even if it will not fit in d/__tzname, so when it returns, s points to the offset digits. --- diff --git a/src/time/__tz.c b/src/time/__tz.c index a962960e..49a7371e 100644 --- a/src/time/__tz.c +++ b/src/time/__tz.c @@ -86,15 +86,15 @@ static void getname(char *d, const char **p) int i; if (**p == '<') { ++*p; - for (i=0; (*p)[i] && (*p)[i]!='>' && i