From d62998c89ce0b3e24669021c83af4e4e5f072aad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= Date: Mon, 17 Feb 2020 14:26:03 +0100 Subject: [PATCH] Fix restoring a verb chaing list when exiting a JIT-compiled recursive function --- ...-verb-chain-restoration-issue-in-JIT.patch | 55 +++++++++++++++++++ pcre2.spec | 10 +++- 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 pcre2-10.34-Fix-control-verb-chain-restoration-issue-in-JIT.patch diff --git a/pcre2-10.34-Fix-control-verb-chain-restoration-issue-in-JIT.patch b/pcre2-10.34-Fix-control-verb-chain-restoration-issue-in-JIT.patch new file mode 100644 index 0000000..04ae437 --- /dev/null +++ b/pcre2-10.34-Fix-control-verb-chain-restoration-issue-in-JIT.patch @@ -0,0 +1,55 @@ +From a6749bb6c7c6fbfe849fb7e4e8dcf9d0e767d3e4 Mon Sep 17 00:00:00 2001 +From: zherczeg +Date: Mon, 10 Feb 2020 10:18:01 +0000 +Subject: [PATCH] Fix control verb chain restoration issue in JIT. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +git-svn-id: svn://vcs.exim.org/pcre2/code/trunk@1217 6239d852-aaf2-0410-a92c-79f79f948069 +Petr Písař: Ported to 10.34. +--- + src/pcre2_jit_compile.c | 8 ++++---- + src/pcre2_jit_test.c | 1 + + +diff --git a/src/pcre2_jit_compile.c b/src/pcre2_jit_compile.c +index 7874fac..10665a8 100644 +--- a/src/pcre2_jit_compile.c ++++ b/src/pcre2_jit_compile.c +@@ -2693,8 +2693,8 @@ while (cc < ccend) + } + if (common->control_head_ptr != 0 && !control_head_found) + { +- shared_srcw[0] = common->control_head_ptr; +- shared_count = 1; ++ private_srcw[0] = common->control_head_ptr; ++ private_count = 1; + control_head_found = TRUE; + } + cc += 1 + 2 + cc[1]; +@@ -2704,8 +2704,8 @@ while (cc < ccend) + SLJIT_ASSERT(common->control_head_ptr != 0); + if (!control_head_found) + { +- shared_srcw[0] = common->control_head_ptr; +- shared_count = 1; ++ private_srcw[0] = common->control_head_ptr; ++ private_count = 1; + control_head_found = TRUE; + } + cc++; +diff --git a/src/pcre2_jit_test.c b/src/pcre2_jit_test.c +index a188724..187e565 100644 +--- a/src/pcre2_jit_test.c ++++ b/src/pcre2_jit_test.c +@@ -861,6 +861,7 @@ static struct regression_test_case regression_test_cases[] = { + { MU, A, 0, 0 | F_NOMATCH, "(?(?=a)a(*THEN)b|ad)", "ad" }, + { MU, A, 0, 0, "(?!(?(?=a)ab|b(*THEN)d))bn|bnn", "bnn" }, + { MU, A, 0, 0, "(?=(*THEN: ))* ", " " }, ++ { MU, A, 0, 0, "a(*THEN)(?R) |", "a" }, + + /* Recurse and control verbs. */ + { MU, A, 0, 0, "(a(*ACCEPT)b){0}a(?1)b", "aacaabb" }, +-- +2.21.1 + diff --git a/pcre2.spec b/pcre2.spec index 0febd40..a0aeee7 100644 --- a/pcre2.spec +++ b/pcre2.spec @@ -9,7 +9,7 @@ #%%global rcversion RC1 Name: pcre2 Version: 10.34 -Release: %{?rcversion:0.}5%{?rcversion:.%rcversion}%{?dist}.1 +Release: %{?rcversion:0.}6%{?rcversion:.%rcversion}%{?dist} %global myversion %{version}%{?rcversion:-%rcversion} Summary: Perl-compatible regular expression library # the library: BSD with exceptions @@ -71,6 +71,9 @@ Patch6: pcre2-10.34-Fix-bug-in-processing-DEFINE-.-within-lookbehind-ass.pat # Prevent from a stack exhaustion when studying a pattern for nested groups by # putting a limit of 1000 recursive calls, in upstream after 10.34 Patch7: pcre2-10.34-Limit-function-recursion-in-pcre2_study-to-avoid-sta.patch +# Fix restoring a verb chaing list when exiting a JIT-compiled recursive +# function, in upstream after 10.34 +Patch8: pcre2-10.34-Fix-control-verb-chain-restoration-issue-in-JIT.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: coreutils @@ -156,6 +159,7 @@ Utilities demonstrating PCRE2 capabilities like pcre2grep or pcre2test. %patch5 -p1 %patch6 -p1 %patch7 -p1 +%patch8 -p1 # Because of multilib patch libtoolize --copy --force autoreconf -vif @@ -253,6 +257,10 @@ make %{?_smp_mflags} check VERBOSE=yes %{_mandir}/man1/pcre2test.* %changelog +* Mon Feb 17 2020 Petr Pisar - 10.34-6 +- Fix restoring a verb chaing list when exiting a JIT-compiled recursive + function + * Wed Jan 29 2020 Fedora Release Engineering - 10.34-5.1 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild