]> granicus.if.org Git - php/commitdiff
- fix #49732, fix crash when timestamp conversion fails
authorPierre Joye <pajoye@php.net>
Thu, 1 Oct 2009 13:55:16 +0000 (13:55 +0000)
committerPierre Joye <pajoye@php.net>
Thu, 1 Oct 2009 13:55:16 +0000 (13:55 +0000)
ext/fileinfo/libmagic/readcdf.c

index 11b362f02aeefdb0e6bbf8d0a29da0f71fea62f3..cf7ee0be4f23a2ddb028de52aade4b0813bb589d 100644 (file)
@@ -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';