Skip to content

Commit c3365bb

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

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)