summaryrefslogtreecommitdiff
path: root/ext/fileinfo
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2014-04-24 19:50:23 +0200
committerAnatol Belski <ab@php.net>2014-04-24 19:50:23 +0200
commitd7bb09cc1d7d413d7e92128028c0b2a11b21b6da (patch)
tree424e720d2745e0bd815c445f48cdd287698c7653 /ext/fileinfo
parent03fa5501a84af2bda7d81c732d46d2a68ee0e855 (diff)
downloadphp-git-d7bb09cc1d7d413d7e92128028c0b2a11b21b6da.tar.gz
backport this piece from 5.6, related to the #66307 fix
Diffstat (limited to 'ext/fileinfo')
-rw-r--r--ext/fileinfo/libmagic/readcdf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/fileinfo/libmagic/readcdf.c b/ext/fileinfo/libmagic/readcdf.c
index ade10b2bf7..820f24d0d7 100644
--- a/ext/fileinfo/libmagic/readcdf.c
+++ b/ext/fileinfo/libmagic/readcdf.c
@@ -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,