Commit: 74555e7c26b2c61bb8e67b7d6a6f4d2b8eb3a5f3 Author: Anatol Belski <a...@php.net> Tue, 14 May 2013 09:40:43 +0200 Parents: 156576fcced43efc558002d504732271f6cc1fe1 Branches: PHP-5.4 PHP-5.5 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=74555e7c26b2c61bb8e67b7d6a6f4d2b8eb3a5f3 Log: Fixed bug #64830 mimetype detection segfaults on mp3 file Bugs: https://bugs.php.net/64830 Changed paths: M NEWS M ext/fileinfo/libmagic/softmagic.c M ext/fileinfo/tests/finfo_file_002.phpt A ext/fileinfo/tests/resources/test.mp3 Diff: diff --git a/NEWS b/NEWS index db1a03b..879f13b 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,9 @@ PHP NEWS - Core: . Fixed bug #64729 (compilation failure on x32). (Gustavo) +- Fileinfo: + . Fixed bug #64830 (mimetype detection segfaults on mp3 file). (Anatol) + - FPM: . Ignore QUERY_STRING when sent in SCRIPT_FILENAME. (Remi) . Fixed some possible memory or resource leaks and possible null dereference diff --git a/ext/fileinfo/libmagic/softmagic.c b/ext/fileinfo/libmagic/softmagic.c index c69fdb5..1e7dbf7 100644 --- a/ext/fileinfo/libmagic/softmagic.c +++ b/ext/fileinfo/libmagic/softmagic.c @@ -1699,7 +1699,7 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m, return -1; if (file_printf(ms, "%s", rbuf) == -1) return -1; - free(rbuf); + efree(rbuf); } return rv; diff --git a/ext/fileinfo/tests/finfo_file_002.phpt b/ext/fileinfo/tests/finfo_file_002.phpt index 3593233..feb4010 100644 --- a/ext/fileinfo/tests/finfo_file_002.phpt +++ b/ext/fileinfo/tests/finfo_file_002.phpt @@ -18,7 +18,7 @@ ksort($results); var_dump($results); ?> --EXPECTF-- -array(7) { +array(8) { ["%s/resources/dir.zip"]=> string(15) "application/zip" ["%s/resources/test.awk"]=> @@ -29,6 +29,8 @@ array(7) { string(9) "image/gif" ["%s/resources/test.jpg"]=> string(10) "image/jpeg" + ["%s/resources/test.mp3"]=> + string(10) "audio/mpeg" ["%s/resources/test.pdf"]=> string(15) "application/pdf" ["%s/resources/test.png"]=> diff --git a/ext/fileinfo/tests/resources/test.mp3 b/ext/fileinfo/tests/resources/test.mp3 new file mode 100644 index 0000000..0b53437 Binary files /dev/null and b/ext/fileinfo/tests/resources/test.mp3 differ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php