File tree Expand file tree Collapse file tree 3 files changed +21
-2
lines changed Expand file tree Collapse file tree 3 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ PHP NEWS
17
17
. Fixed bug #80213 (imap_mail_compose() segfaults on certain $bodies). (cmb)
18
18
. Fixed bug #80215 (imap_mail_compose() may modify by-val parameters). (cmb)
19
19
. Fixed bug #80220 (imap_mail_compose() may leak memory). (cmb)
20
+ . Fixed bug #80223 (imap_mail_compose() leaks envelope on malformed bodies).
21
+ (cmb)
20
22
21
23
- MySQLnd:
22
24
. Fixed bug #80115 (mysqlnd.debug doesn't recognize absolute paths with
Original file line number Diff line number Diff line change @@ -3634,7 +3634,8 @@ PHP_FUNCTION(imap_mail_compose)
3634
3634
3635
3635
if (Z_TYPE_P (data ) != IS_ARRAY ) {
3636
3636
php_error_docref (NULL , E_WARNING , "body parameter must be a non-empty array" );
3637
- RETURN_FALSE ;
3637
+ RETVAL_FALSE ;
3638
+ goto done ;
3638
3639
}
3639
3640
SEPARATE_ARRAY (data );
3640
3641
@@ -3836,7 +3837,8 @@ PHP_FUNCTION(imap_mail_compose)
3836
3837
3837
3838
if (first ) {
3838
3839
php_error_docref (NULL , E_WARNING , "body parameter must be a non-empty array" );
3839
- RETURN_FALSE ;
3840
+ RETVAL_FALSE ;
3841
+ goto done ;
3840
3842
}
3841
3843
3842
3844
if (bod && bod -> type == TYPEMULTIPART && (!bod -> nested .part || !bod -> nested .part -> next )) {
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Bug #80223 (imap_mail_compose() leaks envelope on malformed bodies)
3
+ --SKIPIF--
4
+ <?php
5
+ if (!extension_loaded ('imap ' )) die ('skip imap extension not available ' );
6
+ ?>
7
+ --FILE--
8
+ <?php
9
+ imap_mail_compose ([], []);
10
+ imap_mail_compose ([], [1 ]);
11
+ ?>
12
+ --EXPECTF--
13
+ Warning: imap_mail_compose(): body parameter must be a non-empty array in %s on line %d
14
+
15
+ Warning: imap_mail_compose(): body parameter must be a non-empty array in %s on line %d
You can’t perform that action at this time.
0 commit comments