From: Tom Gundersen Date: Sat, 29 Nov 2014 09:40:21 +0000 (+0100) Subject: shared: time-dst - ensure nulstr is null terminated X-Git-Tag: v218~211 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=681f9718;hp=0acd5a08f5b2ff0580d4fc4d7fc2ff144b2f788f shared: time-dst - ensure nulstr is null terminated Fixes CID #1237772. --- diff --git a/src/shared/time-dst.c b/src/shared/time-dst.c index 6195b1101..926d22b94 100644 --- a/src/shared/time-dst.c +++ b/src/shared/time-dst.c @@ -244,6 +244,8 @@ read_again: 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)