summaryrefslogtreecommitdiff
path: root/ext/imap/tests
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2020-10-10 14:09:07 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2020-10-10 19:17:13 +0200
commit8bee0fbd37c8eee0a17abe4a0afd69ad9ac7105a (patch)
tree0f30d1aab7e51512e9fa74dfb41c7795858f7b81 /ext/imap/tests
parent07a4185df1471fe074c5b5212ae3eefe493c3cbb (diff)
downloadphp-git-8bee0fbd37c8eee0a17abe4a0afd69ad9ac7105a.tar.gz
Fix #80213: imap_mail_compose() segfaults on certain $bodies
We have to cater to non-associative arrays where the key may be `NULL`; we just skip these elements. Closes GH-6315.
Diffstat (limited to 'ext/imap/tests')
-rw-r--r--ext/imap/tests/bug80213.phpt21
1 files changed, 21 insertions, 0 deletions
diff --git a/ext/imap/tests/bug80213.phpt b/ext/imap/tests/bug80213.phpt
new file mode 100644
index 0000000000..9a7961df77
--- /dev/null
+++ b/ext/imap/tests/bug80213.phpt
@@ -0,0 +1,21 @@
+--TEST--
+Bug #80213 (imap_mail_compose() segfaults on certain $bodies)
+--SKIPIF--
+<?php
+if (!extension_loaded('imap')) die('skip imap extension not available');
+?>
+--FILE--
+<?php
+$envelope = [];
+$body = [[
+ 'type.parameters' => ['param'],
+ 'disposition' => ['disp'],
+], [
+ 'type.parameters' => ['param'],
+ 'disposition' => ['disp'],
+]];
+imap_mail_compose($envelope, $body);
+echo "done\n";
+?>
+--EXPECT--
+done