]> granicus.if.org Git - php/commitdiff
MFH: Fixed bug #25918 (Possible crash in mime_content_type()).
authorIlia Alshanetsky <iliaa@php.net>
Mon, 20 Oct 2003 14:37:02 +0000 (14:37 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Mon, 20 Oct 2003 14:37:02 +0000 (14:37 +0000)
NEWS
ext/mime_magic/mime_magic.c

diff --git a/NEWS b/NEWS
index 25750b4df25c8ab67855795668299cf8a510015d..f155312ec415b052df73065fc974cc490da42922 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -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
index 6f44363e0999e3e3a792b8a8841e6a068feacc49..a4b3203b583bcadb3d787a1b5d73c76f0dfd0cba 100644 (file)
@@ -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! */