diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2020-10-12 13:34:07 +0200 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2020-10-12 13:34:19 +0200 |
commit | 5a8958f0f32374e97c18ffa0f11b3e1aac8a7811 (patch) | |
tree | 28970333f4a141299f163acee5eff187a0b630a0 | |
parent | 2cd2ca8884d064643d1e7d667f86959956a14a00 (diff) | |
parent | acce991a37e3ab0f86c1aed3e2008d130d99c0d1 (diff) | |
download | php-git-5a8958f0f32374e97c18ffa0f11b3e1aac8a7811.tar.gz |
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
Fix #80220: imap_mail_compose() may leak memory
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | ext/imap/php_imap.c | 2 |
2 files changed, 2 insertions, 1 deletions
@@ -9,6 +9,7 @@ PHP NEWS - IMAP: . Fixed bug #80213 (imap_mail_compose() segfaults on certain $bodies). (cmb) . Fixed bug #80215 (imap_mail_compose() may modify by-val parameters). (cmb) + . Fixed bug #80220 (imap_mail_compose() may leak memory). (cmb) - Opcache: . Fixed bug #80184 (Complex expression in while / if statements resolves to diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c index e3a90f525f..f08544284b 100644 --- a/ext/imap/php_imap.c +++ b/ext/imap/php_imap.c @@ -3264,7 +3264,7 @@ PHP_FUNCTION(imap_mail_compose) convert_to_string_ex(pvalue); bod->md5 = cpystr(Z_STRVAL_P(pvalue)); } - } else if (Z_TYPE_P(data) == IS_ARRAY) { + } else if (Z_TYPE_P(data) == IS_ARRAY && topbod->type == TYPEMULTIPART) { short type = -1; SEPARATE_ARRAY(data); if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "type", sizeof("type") - 1)) != NULL) { |