projects
/
musl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
526df23
)
avoid out-of-bounds read for invalid quoted timezone
author
Samuel Holland
<samuel@sholland.org>
Sat, 22 Feb 2020 22:01:12 +0000
(16:01 -0600)
committer
Rich Felker
<dalias@aerifal.cx>
Sat, 21 Mar 2020 16:24:40 +0000
(12:24 -0400)
Parsing the timezone name must stop when reaching the null terminator.
In that case, there is no '>' to skip.
src/time/__tz.c
patch
|
blob
|
history
diff --git
a/src/time/__tz.c
b/src/time/__tz.c
index
185642e
..
a962960
100644
(file)
--- a/
src/time/__tz.c
+++ b/
src/time/__tz.c
@@
-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];