1
0
mirror of https://github.com/php/php-src.git synced 2026-04-20 14:31:06 +02:00
Files
archived-php-src/ext/imap/tests/bug80242.phpt
Christoph M. Becker 315b95b065 Fix #80242: imap_mail_compose() segfaults for multipart with rfc822
libc-client expects `TYPEMESSAGE` with an explicit subtype of `RFC822`
to have a `nested.msg` (otherwise there will be a segfault during
free), but not to have any `contents.text.data` (this will leak
otherwise).

Closes GH-6345.
2020-10-20 18:58:45 +02:00

23 lines
422 B
PHP

--TEST--
Bug #80242 (imap_mail_compose() segfaults for multipart with rfc822)
--SKIPIF--
<?php
if (!extension_loaded('imap')) die('skip imap extension not available');
?>
--FILE--
<?php
$bodies = [[
'type' => TYPEMULTIPART,
], [
'type' => TYPETEXT,
'contents.data' => 'some text',
], [
'type' => TYPEMESSAGE,
'subtype' => 'RFC822',
]];
imap_mail_compose([], $bodies);
echo "done\n";
?>
--EXPECT--
done