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