X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Ftime-dst.c;h=2797d1a7968a2b548fa73e3118bbadbeed0f01fe;hb=27cc6f166bdebc0e698fb692993b801db2618866;hp=926d22b94b62fd4c6180f6b96cdebb5caf301760;hpb=681f9718ce322da95578e20ed975dfb34e7edd23;p=elogind.git diff --git a/src/shared/time-dst.c b/src/shared/time-dst.c index 926d22b94..2797d1a79 100644 --- a/src/shared/time-dst.c +++ b/src/shared/time-dst.c @@ -21,18 +21,12 @@ You should have received a copy of the GNU Lesser General Public License along with systemd; If not, see . ***/ -#include #include #include #include -#include #include #include #include -#include -#include -#include -#include #include #include #include @@ -183,7 +177,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;