]> granicus.if.org Git - php/commitdiff
- Merge: Fix #49732, Crashes in fileinfo when corrupted files are given (timestamp...
authorPierre Joye <pajoye@php.net>
Fri, 9 Oct 2009 14:51:25 +0000 (14:51 +0000)
committerPierre Joye <pajoye@php.net>
Fri, 9 Oct 2009 14:51:25 +0000 (14:51 +0000)
ext/fileinfo/libmagic/readcdf.c

index 20462f328648109abcf310457f639fd2c7d74c3a..a12fa9c9b3899764ecfebeba07fb0ff8f00cb8d3 100644 (file)
@@ -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';