chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
machined: when cloning a raw disk image, also set the NOCOW flag
[elogind.git]
/
src
/
shared
/
time-dst.c
diff --git
a/src/shared/time-dst.c
b/src/shared/time-dst.c
index 6195b110176a3f05001a5d0c5d2c02a1795eddac..1ce6f721b7c895a5260d5b01b4faa92905d6f501 100644
(file)
--- a/
src/shared/time-dst.c
+++ b/
src/shared/time-dst.c
@@
-183,7
+183,8
@@
read_again:
return -EINVAL;
}
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;
if (transitions == NULL)
return -EINVAL;
@@
-244,6
+245,8
@@
read_again:
if (fread(zone_names, 1, chars, f) != chars)
return -EINVAL;
if (fread(zone_names, 1, chars, f) != chars)
return -EINVAL;
+ zone_names[chars] = '\0';
+
for (i = 0; i < num_isstd; ++i) {
int c = getc(f);
if (c == EOF)
for (i = 0; i < num_isstd; ++i) {
int c = getc(f);
if (c == EOF)