From: Martin Pitt Date: Mon, 15 Dec 2014 12:06:48 +0000 (+0100) Subject: shared: time-dst: Avoid buffer overflow X-Git-Tag: v219~989 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=e17fb3c1dd21929119968325c46ab98630446032 shared: time-dst: Avoid buffer overflow Commit 681f9718 introduced an additional null terminator for the zone names. Increase the allocation of "transitions" to actually make room for this. --- diff --git a/src/shared/time-dst.c b/src/shared/time-dst.c index 926d22b94..1ce6f721b 100644 --- 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;