summaryrefslogtreecommitdiff
path: root/ext/pcre/tests
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-02-05 11:21:34 +0100
committerNikita Popov <nikita.ppv@gmail.com>2020-02-05 11:21:34 +0100
commit065224190dd897dd3ea2e6cbad7c684cc105132e (patch)
tree0a2ed15a82f6ef93b0f6bfcb35aea40598b7050c /ext/pcre/tests
parentb3f17ea5d55f5c541f07bf28fda95d54bbf958e0 (diff)
parente30f52b919e04d3a057b6759e7d66c01da550bf8 (diff)
downloadphp-git-065224190dd897dd3ea2e6cbad7c684cc105132e.tar.gz
Merge branch 'PHP-7.4'
* PHP-7.4: Fixed bug #79188
Diffstat (limited to 'ext/pcre/tests')
-rw-r--r--ext/pcre/tests/bug79188.phpt13
1 files changed, 13 insertions, 0 deletions
diff --git a/ext/pcre/tests/bug79188.phpt b/ext/pcre/tests/bug79188.phpt
new file mode 100644
index 0000000000..875aad7b98
--- /dev/null
+++ b/ext/pcre/tests/bug79188.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Bug #79188: Memory corruption in preg_replace/preg_replace_callback and unicode
+--FILE--
+<?php
+
+var_dump(preg_replace("//u", "", "a" . str_repeat("\u{1f612}", 10)));
+var_dump(preg_replace_callback(
+ "//u", function() { return ""; }, "a" . str_repeat("\u{1f612}", 10)));
+
+?>
+--EXPECT--
+string(41) "a😒😒😒😒😒😒😒😒😒😒"
+string(41) "a😒😒😒😒😒😒😒😒😒😒"