--- embedaddon/php/ext/fileinfo/libmagic/readcdf.c 2013/07/22 01:31:50 1.1.1.3 +++ embedaddon/php/ext/fileinfo/libmagic/readcdf.c 2014/06/15 20:03:48 1.1.1.4 @@ -56,6 +56,8 @@ cdf_file_property_info(struct magic_set *ms, const cdf const char *s; int len; + memset(&ts, 0, sizeof(ts)); + for (i = 0; i < count; i++) { cdf_print_property_name(buf, sizeof(buf), info[i].pi_id); switch (info[i].pi_type) { @@ -142,11 +144,13 @@ cdf_file_property_info(struct magic_set *ms, const cdf return -1; } else { char *c, *ec; + const time_t sec = ts.tv_sec; if (cdf_timestamp_to_timespec(&ts, tp) == -1) { return -1; } - c = cdf_ctime(&ts.tv_sec, tbuf); - if ((ec = strchr(c, '\n')) != NULL) + c = cdf_ctime(&sec, tbuf); + if (c != NULL && + (ec = strchr(c, '\n')) != NULL) *ec = '\0'; if (NOTMIME(ms) && file_printf(ms,