chiark / gitweb /
path-util: fix path_is_mount_point() for symlinks
[elogind.git] / src / shared / time-dst.c
index 926d22b94b62fd4c6180f6b96cdebb5caf301760..2797d1a7968a2b548fa73e3118bbadbeed0f01fe 100644 (file)
   You should have received a copy of the GNU Lesser General Public License
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
-#include <ctype.h>
 #include <errno.h>
 #include <stddef.h>
 #include <stdio.h>
-#include <stdlib.h>
 #include <string.h>
 #include <time.h>
 #include <endian.h>
-#include <byteswap.h>
-#include <assert.h>
-#include <limits.h>
-#include <unistd.h>
 #include <stdint.h>
 #include <stdbool.h>
 #include <sys/stat.h>
@@ -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;