1
0
mirror of https://github.com/systemd/systemd.git synced 2025-02-09 13:57:42 +03:00

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.
This commit is contained in:
Martin Pitt 2014-12-15 13:06:48 +01:00 committed by David Herrmann
parent d47f6ca5f9
commit e17fb3c1dd

View File

@ -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;