From 65eb7558ba6be1f13529a6d7ed18d922f385d644 Mon Sep 17 00:00:00 2001 From: Pierre Joye Date: Fri, 9 Oct 2009 14:51:25 +0000 Subject: [PATCH] - Merge: Fix #49732, Crashes in fileinfo when corrupted files are given (timestamp fails) --- ext/fileinfo/libmagic/readcdf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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'; -- 2.50.1