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 @@ -10,6 +10,8 @@ PHP NEWS
10
10
. Fixed bug #80213 (imap_mail_compose() segfaults on certain $bodies). (cmb)
11
11
. Fixed bug #80215 (imap_mail_compose() may modify by-val parameters). (cmb)
12
12
. Fixed bug #80220 (imap_mail_compose() may leak memory). (cmb)
13
+ . Fixed bug #80223 (imap_mail_compose() leaks envelope on malformed bodies).
14
+ (cmb)
13
15
14
16
- Opcache:
15
17
. Fixed bug #80184 (Complex expression in while / if statements resolves to
Original file line number Diff line number Diff line change @@ -3172,7 +3172,8 @@ PHP_FUNCTION(imap_mail_compose)
3172
3172
if (Z_TYPE_P (data ) != IS_ARRAY ) {
3173
3173
// TODO ValueError
3174
3174
php_error_docref (NULL , E_WARNING , "body parameter must be a non-empty array" );
3175
- RETURN_FALSE ;
3175
+ RETVAL_FALSE ;
3176
+ goto done ;
3176
3177
}
3177
3178
SEPARATE_ARRAY (data );
3178
3179
@@ -3375,7 +3376,8 @@ PHP_FUNCTION(imap_mail_compose)
3375
3376
if (first ) {
3376
3377
// TODO ValueError
3377
3378
php_error_docref (NULL , E_WARNING , "body parameter must be a non-empty array" );
3378
- RETURN_FALSE ;
3379
+ RETVAL_FALSE ;
3380
+ goto done ;
3379
3381
}
3380
3382
3381
3383
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