xref: /PHP-7.2/ext/mbstring/tests/bug77381.phpt (revision 0dbb581c)
1--TEST--
2Bug #77381 (heap buffer overflow in multibyte match_at)
3--SKIPIF--
4<?php
5if (!extension_loaded('mbstring')) die('skip mbstring extension not available');
6if (!function_exists('mb_ereg')) die('skip mb_ereg() not available');
7?>
8--FILE--
9<?php
10var_dump(mb_ereg("000||0\xfa","0"));
11var_dump(mb_ereg("(?i)000000000000000000000\xf0",""));
12var_dump(mb_ereg("0000\\"."\xf5","0"));
13var_dump(mb_ereg("(?i)FFF00000000000000000\xfd",""));
14?>
15--EXPECTF--
16Warning: mb_ereg(): Pattern is not valid under UTF-8 encoding in %s on line %d
17bool(false)
18
19Warning: mb_ereg(): Pattern is not valid under UTF-8 encoding in %s on line %d
20bool(false)
21
22Warning: mb_ereg(): Pattern is not valid under UTF-8 encoding in %s on line %d
23bool(false)
24
25Warning: mb_ereg(): Pattern is not valid under UTF-8 encoding in %s on line %d
26bool(false)
27