summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/pcre/pcre2lib/pcre2_jit_compile.c2
-rw-r--r--ext/pcre/tests/bug78338.phpt10
2 files changed, 11 insertions, 1 deletions
diff --git a/ext/pcre/pcre2lib/pcre2_jit_compile.c b/ext/pcre/pcre2lib/pcre2_jit_compile.c
index e2b08ba22a..c491be2917 100644
--- a/ext/pcre/pcre2lib/pcre2_jit_compile.c
+++ b/ext/pcre/pcre2lib/pcre2_jit_compile.c
@@ -7288,7 +7288,7 @@ int lgb, rgb, ricount;
PCRE2_SPTR bptr;
uint32_t c;
-GETCHARINC(c, cc);
+c = *cc++;
lgb = UCD_GRAPHBREAK(c);
while (cc < end_subject)
diff --git a/ext/pcre/tests/bug78338.phpt b/ext/pcre/tests/bug78338.phpt
new file mode 100644
index 0000000000..ec5bf1b946
--- /dev/null
+++ b/ext/pcre/tests/bug78338.phpt
@@ -0,0 +1,10 @@
+--TEST--
+Bug #78338 (Array cross-border reading in PCRE)
+--FILE--
+<?php
+$string = hex2bin('2f5c583f3d3f223f3536ff3636ffffffff36a8a8a83636367a7a7a7a3d2aff2f0a');
+preg_match($string, $string);
+echo "DONE\n";
+?>
+--EXPECT--
+DONE