diff options
| author | Scott MacVicar <scottmac@php.net> | 2008-10-22 16:34:40 +0000 |
|---|---|---|
| committer | Scott MacVicar <scottmac@php.net> | 2008-10-22 16:34:40 +0000 |
| commit | a8c8963bc04053c63f1015360ddb690144684c63 (patch) | |
| tree | bdd9a3081be3093ec9694ede732162de75df3800 /ext | |
| parent | a6ec097f684cba71527353352474671e643f21d2 (diff) | |
| download | php-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.c | 9 |
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; } |
