]> granicus.if.org Git - php/commitdiff
backport this piece from 5.6, related to the #66307 fix
authorAnatol Belski <ab@php.net>
Thu, 24 Apr 2014 17:50:23 +0000 (19:50 +0200)
committerAnatol Belski <ab@php.net>
Thu, 24 Apr 2014 17:50:23 +0000 (19:50 +0200)
ext/fileinfo/libmagic/readcdf.c

index ade10b2bf70bf0cee9af0109dea534aeb670cb26..820f24d0d781f6940575ee82fb2178c9fc1c03f0 100644 (file)
@@ -149,7 +149,8 @@ cdf_file_property_info(struct magic_set *ms, const cdf_property_info_t *info,
                                                                                        return -1;
                                                                                }
                                         c = cdf_ctime(&sec, tbuf);
-                                        if ((ec = strchr(c, '\n')) != NULL)
+                                        if (c != NULL &&
+                                           (ec = strchr(c, '\n')) != NULL)
                                                 *ec = '\0';
 
                                         if (NOTMIME(ms) && file_printf(ms,