Skip to content

Commit 5a8958f

Browse files
committed
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4: Fix #80220: imap_mail_compose() may leak memory
2 parents 2cd2ca8 + acce991 commit 5a8958f

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ PHP NEWS
99
- IMAP:
1010
. Fixed bug #80213 (imap_mail_compose() segfaults on certain $bodies). (cmb)
1111
. Fixed bug #80215 (imap_mail_compose() may modify by-val parameters). (cmb)
12+
. Fixed bug #80220 (imap_mail_compose() may leak memory). (cmb)
1213

1314
- Opcache:
1415
. Fixed bug #80184 (Complex expression in while / if statements resolves to

ext/imap/php_imap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3264,7 +3264,7 @@ PHP_FUNCTION(imap_mail_compose)
32643264
convert_to_string_ex(pvalue);
32653265
bod->md5 = cpystr(Z_STRVAL_P(pvalue));
32663266
}
3267-
} else if (Z_TYPE_P(data) == IS_ARRAY) {
3267+
} else if (Z_TYPE_P(data) == IS_ARRAY && topbod->type == TYPEMULTIPART) {
32683268
short type = -1;
32693269
SEPARATE_ARRAY(data);
32703270
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "type", sizeof("type") - 1)) != NULL) {

0 commit comments

Comments
 (0)