We have to clean up even on failure.
Closes GH-6322.
. 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)
+ . Fixed bug #80223 (imap_mail_compose() leaks envelope on malformed bodies).
+ (cmb)
- MySQLnd:
. Fixed bug #80115 (mysqlnd.debug doesn't recognize absolute paths with
if (Z_TYPE_P(data) != IS_ARRAY) {
php_error_docref(NULL, E_WARNING, "body parameter must be a non-empty array");
- RETURN_FALSE;
+ RETVAL_FALSE;
+ goto done;
}
SEPARATE_ARRAY(data);
if (first) {
php_error_docref(NULL, E_WARNING, "body parameter must be a non-empty array");
- RETURN_FALSE;
+ RETVAL_FALSE;
+ goto done;
}
if (bod && bod->type == TYPEMULTIPART && (!bod->nested.part || !bod->nested.part->next)) {
--- /dev/null
+--TEST--
+Bug #80223 (imap_mail_compose() leaks envelope on malformed bodies)
+--SKIPIF--
+<?php
+if (!extension_loaded('imap')) die('skip imap extension not available');
+?>
+--FILE--
+<?php
+imap_mail_compose([], []);
+imap_mail_compose([], [1]);
+?>
+--EXPECTF--
+Warning: imap_mail_compose(): body parameter must be a non-empty array in %s on line %d
+
+Warning: imap_mail_compose(): body parameter must be a non-empty array in %s on line %d