mirror of
https://git.musl-libc.org/git/musl
synced 2025-01-10 08:42:02 +03:00
avoid out-of-bounds read for invalid quoted timezone
Parsing the timezone name must stop when reaching the null terminator. In that case, there is no '>' to skip.
This commit is contained in:
parent
526df238d0
commit
8e452abae6
@ -86,9 +86,9 @@ static void getname(char *d, const char **p)
|
||||
int i;
|
||||
if (**p == '<') {
|
||||
++*p;
|
||||
for (i=0; (*p)[i]!='>' && i<TZNAME_MAX; i++)
|
||||
for (i=0; (*p)[i] && (*p)[i]!='>' && i<TZNAME_MAX; i++)
|
||||
d[i] = (*p)[i];
|
||||
++*p;
|
||||
if ((*p)[i]) ++*p;
|
||||
} else {
|
||||
for (i=0; ((*p)[i]|32)-'a'<26U && i<TZNAME_MAX; i++)
|
||||
d[i] = (*p)[i];
|
||||
|
Loading…
Reference in New Issue
Block a user