1
0
mirror of https://github.com/php/php-src.git synced 2026-04-18 21:41:22 +02:00
Files
archived-php-src/ext/imap/tests/bug80216.phpt
Christoph M. Becker 73e43b6e19 Fix #80216: imap_mail_compose() does not validate types/encodings
We need to check whether the given `type`s and `encoding`s are within
bounds to avoid segfaults and out-of-bound reads.

Closes GH-6323.
2020-10-12 16:27:49 +02:00

18 lines
498 B
PHP

--TEST--
Bug #80216 (imap_mail_compose() does not validate types/encodings)
--SKIPIF--
<?php
if (!extension_loaded('imap')) die('skip imap extension not available');
?>
--FILE--
<?php
imap_mail_compose([], [['type' => TYPEMULTIPART], []]);
imap_mail_compose([], [['type' => 12]]);
imap_mail_compose([], [['type' => TYPEMULTIPART], ['type' => 12]]);
imap_mail_compose([], [['encoding' => 8]]);
imap_mail_compose([], [['type' => TYPEMULTIPART], ['encoding' => 8]]);
echo "done\n";
?>
--EXPECT--
done