diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2003-10-20 14:36:51 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2003-10-20 14:36:51 +0000 |
commit | 30cc4dc8c9fb27d04516bc338f13713b8bf778d4 (patch) | |
tree | 22faabd5f5804b6e3a020d936dc3d674283786a2 /ext/mime_magic | |
parent | 21fceae7d6ba6df4510de1b5144b9d93c7709b52 (diff) | |
download | php-git-30cc4dc8c9fb27d04516bc338f13713b8bf778d4.tar.gz |
Fixed bug #25918 (Possible crash in mime_content_type()).
Diffstat (limited to 'ext/mime_magic')
-rw-r--r-- | ext/mime_magic/mime_magic.c | 5 |
1 files changed, 2 insertions, 3 deletions
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! */ |