summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorScott MacVicar <scottmac@php.net>2008-10-22 16:34:40 +0000
committerScott MacVicar <scottmac@php.net>2008-10-22 16:34:40 +0000
commita8c8963bc04053c63f1015360ddb690144684c63 (patch)
treebdd9a3081be3093ec9694ede732162de75df3800 /ext
parenta6ec097f684cba71527353352474671e643f21d2 (diff)
downloadphp-git-a8c8963bc04053c63f1015360ddb690144684c63.tar.gz
MFH: Fix a stat on a null when the internal database is used.
Diffstat (limited to 'ext')
-rw-r--r--ext/fileinfo/libmagic/apprentice.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/ext/fileinfo/libmagic/apprentice.c b/ext/fileinfo/libmagic/apprentice.c
index 5e4b2bdad5..97e52c0610 100644
--- a/ext/fileinfo/libmagic/apprentice.c
+++ b/ext/fileinfo/libmagic/apprentice.c
@@ -257,9 +257,12 @@ apprentice_1(struct magic_set *ms, const char *fn, int action,
}
if ((rv = apprentice_map(ms, &magic, &nmagic, fn)) == -1) {
- if (ms->flags & MAGIC_CHECK)
- file_magwarn(ms, "using regular magic file `%s'", fn);
- rv = apprentice_load(ms, &magic, &nmagic, fn, action);
+ if (fn) {
+ if (ms->flags & MAGIC_CHECK)
+ file_magwarn(ms, "using regular magic file `%s'", fn);
+ rv = apprentice_load(ms, &magic, &nmagic, fn, action);
+ }
+
if (rv != 0)
return -1;
}