Fix bug #77371 (heap buffer overflow in mb regex functions - compile_string_node)

This commit is contained in:
Stanislav Malyshev committed 2019-01-06 11:33:54 -08:00
1 parent 20407d06ca
commit 28362ed4fa
2 files changed
+11

No files matched your search

+1
View File
@@ -524,6 +524,7 @@ compile_string_node(Node* node, regex_t* reg)
for (; p < end; ) {
len = enclen(enc, p);
if (p + len > end) len = end - p;
if (len == prev_len) {
slen++;
}
+10
View File
@@ -0,0 +1,10 @@
--TEST--
Bug #77371 (heap buffer overflow in mb regex functions - compile_string_node)
--SKIPIF--
<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
--FILE--
<?php
var_dump(mb_ereg("()0\xfc00000\xfc00000\xfc00000\xfc",""))
?>
--EXPECT--
bool(false)