xref: /PHP-8.0/ext/mbstring/tests/bug78559.phpt (revision 8f949eba)
1--TEST--
2Bug #78559 (#78559	Heap buffer overflow in mb_eregi)
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
10$str = "5b5b5b5b5b5b5b492a5bce946b5c4b5d5c6b5c4b5d5c4b5d1cceb04b5d1cceb07a73717e4b1c52525252525252525252525252525252525252525252525252492a5bce946b5c4b5d5c6b5c4b5d5c4b5d1cceb04b5d1cceb07a73717e4b1c1cceb04b5d1cceb07a73717e4b1c302c36303030ceb07b7bd2a15c305c30663f436f6e74655c5238416711087b363030302c36303030ceb07b7b7b7b7b7b7b363030302c36303030ceb07b7b7b7b7b7b7b4a01";
11$str = hex2bin($str);
12var_dump(mb_eregi($str, $str));
13?>
14--EXPECT--
15bool(false)
16