From: Ilia Alshanetsky Date: Tue, 8 Apr 2008 00:01:48 +0000 (+0000) Subject: Fixed bug #44663 (Crash in imap_mail_compose if "body" parameter invalid) X-Git-Tag: BEFORE_NEW_PARAMETER_PARSE~417 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f728678bb849258add7555b4f5d53f5fb43e31fd;p=php Fixed bug #44663 (Crash in imap_mail_compose if "body" parameter invalid) --- diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c index bd7a272c65..cab5f7e5b6 100644 --- a/ext/imap/php_imap.c +++ b/ext/imap/php_imap.c @@ -3047,8 +3047,8 @@ PHP_FUNCTION(imap_mail_compose) } zend_hash_internal_pointer_reset(Z_ARRVAL_PP(body)); - if (zend_hash_get_current_data(Z_ARRVAL_PP(body), (void **) &data) != SUCCESS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "body parameter cannot be empty"); + if (zend_hash_get_current_data(Z_ARRVAL_PP(body), (void **) &data) != SUCCESS || Z_TYPE_PP(data) != IS_ARRAY) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "body parameter must be a non-empty array"); RETURN_FALSE; }