summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2003-10-20 14:37:02 +0000
committerIlia Alshanetsky <iliaa@php.net>2003-10-20 14:37:02 +0000
commit25679a60c73497ed5cdb156477da73c573532a70 (patch)
tree04f6a03106f9b2a5e2e7cb622a60d369cf14d31a
parentafd9e80cb18aaad1d5ca9dc524e3ef0f8704611e (diff)
downloadphp-git-25679a60c73497ed5cdb156477da73c573532a70.tar.gz
MFH: Fixed bug #25918 (Possible crash in mime_content_type()).
-rw-r--r--NEWS1
-rw-r--r--ext/mime_magic/mime_magic.c5
2 files changed, 3 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index 25750b4df2..f155312ec4 100644
--- 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
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! */