From: Ilia Alshanetsky Date: Tue, 8 Apr 2008 00:02:01 +0000 (+0000) Subject: MFB: Fixed bug #44663 (Crash in imap_mail_compose if "body" parameter X-Git-Tag: RELEASE_2_0_0b1~487 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=01ef65015bb9f3fd470b892c59e56d37d50c8d5f;p=php MFB: 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 c695735b27..5626b82d93 100644 --- a/ext/imap/php_imap.c +++ b/ext/imap/php_imap.c @@ -3046,8 +3046,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; }