From: Pierre Joye Date: Fri, 9 Oct 2009 14:51:25 +0000 (+0000) Subject: - Merge: Fix #49732, Crashes in fileinfo when corrupted files are given (timestamp... X-Git-Tag: php-5.3.1RC2~49 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=65eb7558ba6be1f13529a6d7ed18d922f385d644;p=php - Merge: Fix #49732, Crashes in fileinfo when corrupted files are given (timestamp fails) --- diff --git a/ext/fileinfo/libmagic/readcdf.c b/ext/fileinfo/libmagic/readcdf.c index 20462f3286..a12fa9c9b3 100644 --- a/ext/fileinfo/libmagic/readcdf.c +++ b/ext/fileinfo/libmagic/readcdf.c @@ -125,7 +125,10 @@ cdf_file_property_info(struct magic_set *ms, const cdf_property_info_t *info, return -1; } else { char *c, *ec; - cdf_timestamp_to_timespec(&ts, tp); + + if (cdf_timestamp_to_timespec(&ts, tp) == -1) { + return -1; + } c = ctime(&ts.tv_sec); if ((ec = strchr(c, '\n')) != NULL) *ec = '\0';