From 13bdff44bcbb17a833022b71926cd5bb36875d12 Mon Sep 17 00:00:00 2001 From: Pierre Joye Date: Thu, 1 Oct 2009 13:55:16 +0000 Subject: [PATCH] - fix #49732, fix crash when timestamp conversion 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 11b362f02a..cf7ee0be4f 100644 --- a/ext/fileinfo/libmagic/readcdf.c +++ b/ext/fileinfo/libmagic/readcdf.c @@ -123,7 +123,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