diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2003-10-20 14:37:02 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2003-10-20 14:37:02 +0000 |
commit | 25679a60c73497ed5cdb156477da73c573532a70 (patch) | |
tree | 04f6a03106f9b2a5e2e7cb622a60d369cf14d31a | |
parent | afd9e80cb18aaad1d5ca9dc524e3ef0f8704611e (diff) | |
download | php-git-25679a60c73497ed5cdb156477da73c573532a70.tar.gz |
MFH: Fixed bug #25918 (Possible crash in mime_content_type()).
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | ext/mime_magic/mime_magic.c | 5 |
2 files changed, 3 insertions, 3 deletions
@@ -6,6 +6,7 @@ PHP 4 NEWS - Fixed multibyte regex engine to properly handle ".*" pattern under POSIX compatible mode. (K.Kosako <kosako at sofnec.co.jp>, Moriyoshi) - Fixed bug #25923 (mail() modifies the to & subject arguments). (Ilia) +- Fixed bug #25918 (Possible crash in mime_content_type()). (Ilia) - Fixed bug #25895 (Incorrect detection of safe_mode limited ini options). (Ilia) - Fixed bug #25836 (last key of multi-dimensional array passed via GPC not diff --git a/ext/mime_magic/mime_magic.c b/ext/mime_magic/mime_magic.c index 6f44363e09..a4b3203b58 100644 --- a/ext/mime_magic/mime_magic.c +++ b/ext/mime_magic/mime_magic.c @@ -1848,9 +1848,8 @@ static int magic_rsl_get(char **content_type, char **content_encoding) } /* detect memory allocation errors */ - if (!content_type || - (state == rsl_encoding && !*content_encoding)) { - return MIME_MAGIC_ERROR; + if (!content_type || !(*content_type) || (state == rsl_encoding && !*content_encoding)) { + return MIME_MAGIC_ERROR; } /* success! */ |