diff options
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | ext/fileinfo/libmagic.patch | 10 | ||||
-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 | |||
-rw-r--r-- | ext/mysql/php_mysql.c | 2 |
6 files changed, 15 insertions, 6 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.patch b/ext/fileinfo/libmagic.patch index ced3b2bb51..97e771e920 100644 --- a/ext/fileinfo/libmagic.patch +++ b/ext/fileinfo/libmagic.patch @@ -2978,7 +2978,7 @@ diff -u libmagic.orig/readelf.h libmagic/readelf.h typedef uint8_t Elf64_Char; diff -u libmagic.orig/softmagic.c libmagic/softmagic.c --- libmagic.orig/softmagic.c 2013-03-21 18:45:14.000000000 +0100 -+++ libmagic/softmagic.c 2013-04-08 15:42:57.328298809 +0200 ++++ libmagic/softmagic.c 2013-05-14 11:00:07.044745939 +0200 @@ -41,6 +41,11 @@ #include <stdlib.h> #include <time.h> @@ -3123,7 +3123,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c } } -@@ -1717,9 +1694,9 @@ +@@ -1717,12 +1694,12 @@ ms->o.buf = sbuf; ms->offset = soffset; if (rv == 1) { @@ -3134,7 +3134,11 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c + return -1; if (file_printf(ms, "%s", rbuf) == -1) return -1; - free(rbuf); +- free(rbuf); ++ efree(rbuf); + } + return rv; + @@ -1837,6 +1814,42 @@ return file_strncmp(a, b, len, flags); } 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 diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c index 5ad7bc903d..db0e5a1fc5 100644 --- a/ext/mysql/php_mysql.c +++ b/ext/mysql/php_mysql.c @@ -720,7 +720,7 @@ PHP_MINFO_FUNCTION(mysql) static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) { char *user=NULL, *passwd=NULL, *host_and_port=NULL, *socket=NULL, *tmp=NULL, *host=NULL; - int user_len, passwd_len, host_len; + int user_len = 0, passwd_len = 0, host_len = 0; char *hashed_details=NULL; int hashed_details_length, port = MYSQL_PORT; long client_flags = 0; |