cvs: php-src /ext/fileinfo/libmagic apprentice.c
| From: | Scott MacVicar | Date: | Wed, 22 Oct 2008 16:34:17 +0000 |
| Subject: | cvs: php-src /ext/fileinfo/libmagic apprentice.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-53662@lists.php.net to get a copy of this message | ||
scottmac Wed Oct 22 16:34:17 2008 UTC
Modified files:
/php-src/ext/fileinfo/libmagic apprentice.c
Log:
Fix a stat on a null when the internal database is used.
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/libmagic/apprentice.c?r1=1.15&r2=1.16&diff_format=u
Index: php-src/ext/fileinfo/libmagic/apprentice.c
diff -u php-src/ext/fileinfo/libmagic/apprentice.c:1.15
php-src/ext/fileinfo/libmagic/apprentice.c:1.16
--- php-src/ext/fileinfo/libmagic/apprentice.c:1.15 Wed Oct 22 13:59:08 2008
+++ php-src/ext/fileinfo/libmagic/apprentice.c Wed Oct 22 16:34:17 2008
@@ -251,9 +251,12 @@
}
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;
}