diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2003-02-03 21:24:32 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2003-02-03 21:24:32 +0000 |
commit | 065e4d655094b12273c09fdd43807af4043ed962 (patch) | |
tree | 85a15e24da53f4359ab53685a15f68f46f737089 /ext/imap/php_imap.c | |
parent | b0924da0cf7168a5d51744a1ee82333dd8c3d246 (diff) | |
download | php-git-065e4d655094b12273c09fdd43807af4043ed962.tar.gz |
Fixed bug #22022 (Crash in imap_mail_compose() if the body is an empty array).
Diffstat (limited to 'ext/imap/php_imap.c')
-rw-r--r-- | ext/imap/php_imap.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c index 41918579fa..944f27a16a 100644 --- a/ext/imap/php_imap.c +++ b/ext/imap/php_imap.c @@ -2807,7 +2807,10 @@ PHP_FUNCTION(imap_mail_compose) } zend_hash_internal_pointer_reset(Z_ARRVAL_PP(body)); - zend_hash_get_current_data(Z_ARRVAL_PP(body), (void **) &data); + 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"); + RETURN_FALSE; + } zend_hash_get_current_key(Z_ARRVAL_PP(body), &key, &ind, 0); /* FIXME: is this necessary? we're not using key/ind */ if (Z_TYPE_PP(data) == IS_ARRAY) { |