projects
/
platform
/
upstream
/
systemd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d47f6ca
)
shared: time-dst: Avoid buffer overflow
author
Martin Pitt
<martin.pitt@ubuntu.com>
Mon, 15 Dec 2014 12:06:48 +0000
(13:06 +0100)
committer
David Herrmann
<dh.herrmann@gmail.com>
Mon, 15 Dec 2014 12:50:11 +0000
(13:50 +0100)
Commit
681f9718
introduced an additional null terminator for the zone names.
Increase the allocation of "transitions" to actually make room for this.
src/shared/time-dst.c
patch
|
blob
|
history
diff --git
a/src/shared/time-dst.c
b/src/shared/time-dst.c
index
926d22b
..
1ce6f72
100644
(file)
--- a/
src/shared/time-dst.c
+++ b/
src/shared/time-dst.c
@@
-183,7
+183,8
@@
read_again:
return -EINVAL;
}
- transitions = malloc0(total_size + tzspec_len);
+ /* leave space for additional zone_names zero terminator */
+ transitions = malloc0(total_size + tzspec_len + 1);
if (transitions == NULL)
return -EINVAL;