]> granicus.if.org Git - php/commitdiff
MFB: Fixed bug #44663 (Crash in imap_mail_compose if "body" parameter
authorIlia Alshanetsky <iliaa@php.net>
Tue, 8 Apr 2008 00:02:01 +0000 (00:02 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 8 Apr 2008 00:02:01 +0000 (00:02 +0000)
invalid)

ext/imap/php_imap.c

index c695735b27e63027f27c33aeb9e71f6f404b58ca..5626b82d93e5c97ca704fa9e271dbce83e373948 100644 (file)
@@ -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;
        }