diff options
| author | Anatol Belski <ab@php.net> | 2013-05-14 09:40:43 +0200 |
|---|---|---|
| committer | Anatol Belski <ab@php.net> | 2013-05-14 09:40:43 +0200 |
| commit | 74555e7c26b2c61bb8e67b7d6a6f4d2b8eb3a5f3 (patch) | |
| tree | c7eb278343d46181c6471e2b22b0dbab63938e60 | |
| parent | 156576fcced43efc558002d504732271f6cc1fe1 (diff) | |
| download | php-git-74555e7c26b2c61bb8e67b7d6a6f4d2b8eb3a5f3.tar.gz | |
Fixed bug #64830 mimetype detection segfaults on mp3 file
| -rw-r--r-- | NEWS | 3 | ||||
| -rw-r--r-- | ext/fileinfo/libmagic/softmagic.c | 2 | ||||
| -rw-r--r-- | ext/fileinfo/tests/finfo_file_002.phpt | 4 | ||||
| -rw-r--r-- | ext/fileinfo/tests/resources/test.mp3 | bin | 0 -> 4280555 bytes |
4 files changed, 7 insertions, 2 deletions
@@ -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 c69fdb5a3e..1e7dbf7449 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 3593233c39..feb4010f74 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 Binary files differnew file mode 100644 index 0000000000..0b534374b3 --- /dev/null +++ b/ext/fileinfo/tests/resources/test.mp3 |
