Bug #80216 [NEW]: imap_mail_compose() segfaults on multipart w/o part type
| From: | cmb@php.net | Date: | Sat, 10 Oct 2020 16:35:00 +0000 |
| Subject: | Bug #80216 [NEW]: imap_mail_compose() segfaults on multipart w/o part type | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-229513@lists.php.net to get a copy of this message | ||
From: cmb
Operating system: *
PHP version: 7.3Git-2020-10-10 (Git)
Package: IMAP related
Bug Type: Bug
Bug description:imap_mail_compose() segfaults on multipart w/o part type
Description:
------------
If imap_mail_compose() is used to create a multipart MIME message
without specifying explicit types for the individual parts, that
leads to a segfault. Since the type for the first body defaults
to TYPETEXT, I would expect the individual parts to default to
TYPETEXT as well.
Test script:
---------------
<?php
$envelope = [
'from' => 'me@example.com',
'to' => 'you@example.com',
'subject' => 'hello',
];
$body = [[
'type' => TYPEMULTIPART,
], [
'contents.data' => 'yada yada',
]];
echo imap_mail_compose($envelope, $body);
?>
Expected result:
----------------
From: me@example.com
Subject: hello
To: you@example.com
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED; BOUNDARY="321-1709-1602347443=:9960"
--321-1709-1602347443=:9960
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
yada yada
--321-1709-1602347443=:9960--
Actual result:
--------------
segfault
--
Edit bug report at https://bugs.php.net/bug.php?id=80216&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=80216&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=80216&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=80216&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=80216&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=80216&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=80216&r=support
Expected behavior: https://bugs.php.net/fix.php?id=80216&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=80216&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=80216&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=80216&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80216&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=80216&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=80216&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=80216&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=80216&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=80216&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=80216&r=mysqlcfg