From 8947fd9e9fdce87cd6c59817b1db58e789538fe9 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Mon, 29 Jul 2019 19:31:47 +0200 Subject: [PATCH] Fix #78338: Array cross-border reading in PCRE We backport r1092 from pcre2. --- ext/pcre/pcre2lib/pcre2_jit_compile.c | 2 +- ext/pcre/tests/bug78338.phpt | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 ext/pcre/tests/bug78338.phpt 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-- + +--EXPECT-- +DONE -- 2.40.0