From: Ilia Alshanetsky Date: Mon, 20 Oct 2003 14:36:51 +0000 (+0000) Subject: Fixed bug #25918 (Possible crash in mime_content_type()). X-Git-Tag: RELEASE_1_3b3~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=30cc4dc8c9fb27d04516bc338f13713b8bf778d4;p=php Fixed bug #25918 (Possible crash in mime_content_type()). --- diff --git a/ext/mime_magic/mime_magic.c b/ext/mime_magic/mime_magic.c index a345dc2e20..05d02d13d7 100644 --- a/ext/mime_magic/mime_magic.c +++ b/ext/mime_magic/mime_magic.c @@ -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! */