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

index a345dc2e2056d4c23414b86b32ce26897d73430f..05d02d13d7c5c9e88139175c5a89106552a44806 100644 (file)
@@ -1954,9 +1954,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! */