php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80242 imap_mail_compose() segfaults for multipart with rfc822
Submitted: 2020-10-15 17:03 UTC Modified: 2020-10-15 17:22 UTC
From: cmb@php.net Assigned: cmb (profile)
Status: Closed Package: IMAP related
PHP Version: 7.3Git-2020-10-15 (Git) OS: *
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: cmb@php.net
New email:
PHP Version: OS:

 

 [2020-10-15 17:03 UTC] cmb@php.net
Description:
------------
When imap_mail_compose() is used to compose a multipart message
with one or more message/rfc822 parts where the subtype is
explicitly specified, the function segfaults.

Note that composing a multipart message with one or more
message/rfc822 where the subtype is not explicitly specified does
not segfault, due to the way this is handled by lib-client (2007).


Test script:
---------------
<?php
$bodies = [[
    'type' => TYPEMULTIPART,
], [
    'type' => TYPETEXT,
    'contents.data' => 'some text',
], [
    'type' => TYPEMESSAGE,
    'subtype' => 'RFC822',
]];
imap_mail_compose([], $bodies);
echo "done\n";
?>


Expected result:
----------------
done


Actual result:
--------------
segfault


Patches

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-10-15 17:22 UTC] cmb@php.net
-Assigned To: +Assigned To: cmb
 [2020-10-16 12:12 UTC] cmb@php.net
The following pull request has been associated:

Patch Name: Fix #80242: imap_mail_compose() segfaults for multipart with rfc822
On GitHub:  https://github.com/php/php-src/pull/6345
Patch:      https://github.com/php/php-src/pull/6345.patch
 [2020-10-20 17:03 UTC] cmb@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=315b95b0654fca116d6db0f11dc22151ac139988
Log: Fix #80242: imap_mail_compose() segfaults for multipart with rfc822
 [2020-10-20 17:03 UTC] cmb@php.net
-Status: Assigned +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Dec 03 16:01:33 2024 UTC