summaryrefslogtreecommitdiff
path: root/ext/pcre/tests/bug73612.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pcre/tests/bug73612.phpt')
-rw-r--r--ext/pcre/tests/bug73612.phpt27
1 files changed, 27 insertions, 0 deletions
diff --git a/ext/pcre/tests/bug73612.phpt b/ext/pcre/tests/bug73612.phpt
new file mode 100644
index 0000000000..707e10bce6
--- /dev/null
+++ b/ext/pcre/tests/bug73612.phpt
@@ -0,0 +1,27 @@
+--TEST--
+Bug #73612 (preg_*() may leak memory)
+--FILE--
+<?php
+$obj = new stdClass;
+$obj->obj = $obj;
+preg_match('/./', 'x', $obj);
+
+$obj = new stdClass;
+$obj->obj = $obj;
+preg_replace('/./', '', 'x', -1, $obj);
+
+$obj = new stdClass;
+$obj->obj = $obj;
+preg_replace_callback('/./', 'count', 'x', -1, $obj);
+
+$obj = new stdClass;
+$obj->obj = $obj;
+preg_replace_callback_array(['/./' => 'count'], 'x', -1, $obj);
+
+$obj = new stdClass;
+$obj->obj = $obj;
+preg_filter('/./', '', 'x', -1, $obj);
+?>
+===DONE===
+--EXPECT--
+===DONE===