diff --git a/pcre2-10.36-Fix-K-within-recursion-bug-in-interpreter.patch b/pcre2-10.36-Fix-K-within-recursion-bug-in-interpreter.patch new file mode 100644 index 0000000..d8da57a --- /dev/null +++ b/pcre2-10.36-Fix-K-within-recursion-bug-in-interpreter.patch @@ -0,0 +1,61 @@ +From 1ef05f50d623582e8493ab49cfe0c243eed175c9 Mon Sep 17 00:00:00 2001 +From: ph10 +Date: Thu, 18 Feb 2021 09:46:08 +0000 +Subject: [PATCH] Fix \K within recursion bug in interpreter. +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@1301 6239d852-aaf2-0410-a92c-79f79f948069 +Petr Písař: Ported to 10.36. +--- + src/pcre2_match.c | 4 +++- + testdata/testinput1 | 3 +++ + testdata/testoutput1 | 4 ++++ + +diff --git a/src/pcre2_match.c b/src/pcre2_match.c +index e3f78c2..7d9cad0 100644 +--- a/src/pcre2_match.c ++++ b/src/pcre2_match.c +@@ -818,10 +818,12 @@ fprintf(stderr, "++ op=%d\n", *Fecode); + + /* N is now the frame of the recursion; the previous frame is at the + OP_RECURSE position. Go back there, copying the current subject position +- and mark, and move on past the OP_RECURSE. */ ++ and mark, and the start_match position (\K might have changed it), and ++ then move on past the OP_RECURSE. */ + + P->eptr = Feptr; + P->mark = Fmark; ++ P->start_match = Fstart_match; + F = P; + Fecode += 1 + LINK_SIZE; + continue; +diff --git a/testdata/testinput1 b/testdata/testinput1 +index bb4ddb7..4cf1126 100644 +--- a/testdata/testinput1 ++++ b/testdata/testinput1 +@@ -6429,4 +6429,7 @@ ef) x/x,mark + /a{65536/ + >a{65536< + ++/a\K.(?0)*/ ++ abac ++ + # End of testinput1 +diff --git a/testdata/testoutput1 b/testdata/testoutput1 +index 05b310b..8d4c108 100644 +--- a/testdata/testoutput1 ++++ b/testdata/testoutput1 +@@ -10188,4 +10188,8 @@ No match + >a{65536< + 0: a{65536 + ++/a\K.(?0)*/ ++ abac ++ 0: c ++ + # End of testinput1 +-- +2.26.2 + diff --git a/pcre2-10.36-Restore-single-character-repetition-optimization-in-.patch b/pcre2-10.36-Restore-single-character-repetition-optimization-in-.patch new file mode 100644 index 0000000..acca1ec --- /dev/null +++ b/pcre2-10.36-Restore-single-character-repetition-optimization-in-.patch @@ -0,0 +1,29 @@ +From 29dd457d21ec0350bd9d55f33c0e53ca285d52c2 Mon Sep 17 00:00:00 2001 +From: zherczeg +Date: Fri, 19 Feb 2021 09:20:37 +0000 +Subject: [PATCH] Restore single character repetition optimization 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@1302 6239d852-aaf2-0410-a92c-79f79f948069 +Petr Písař: Ported to 10.36. +--- + src/pcre2_jit_compile.c | 2 +- + +diff --git a/src/pcre2_jit_compile.c b/src/pcre2_jit_compile.c +index 1977d28..3281464 100644 +--- a/src/pcre2_jit_compile.c ++++ b/src/pcre2_jit_compile.c +@@ -1226,7 +1226,7 @@ while (cc < ccend) + return TRUE; + } + +-#define EARLY_FAIL_ENHANCE_MAX (1 + 1) ++#define EARLY_FAIL_ENHANCE_MAX (1 + 3) + + /* + start: +-- +2.26.2 + diff --git a/pcre2.spec b/pcre2.spec index d678ee1..46babec 100644 --- a/pcre2.spec +++ b/pcre2.spec @@ -9,7 +9,7 @@ #%%global rcversion RC1 Name: pcre2 Version: 10.36 -Release: %{?rcversion:0.}3%{?rcversion:.%rcversion}%{?dist} +Release: %{?rcversion:0.}4%{?rcversion:.%rcversion}%{?dist} %global myversion %{version}%{?rcversion:-%rcversion} Summary: Perl-compatible regular expression library # the library: BSD with exceptions @@ -58,6 +58,11 @@ Patch1: pcre2-10.36-Get-rid-of-gcc-fanalyzer-error-though-it-was-probabl.pat # a closing bracket as a quantifier, upstream bug #2690, in upstream after # 10.36 Patch2: pcre2-10.36-Fix-some-numerical-checking-bugs-Bugzilla-2690.patch +# Fix a mismatch if \K was involved in a recursion, in upstream after 10.36 +Patch3: pcre2-10.36-Fix-K-within-recursion-bug-in-interpreter.patch +# Restore single character repetition optimization in JIT, upstream bug #2698, +# in upstream after 10.36 +Patch4: pcre2-10.36-Restore-single-character-repetition-optimization-in-.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: coreutils @@ -261,6 +266,10 @@ make %{?_smp_mflags} check VERBOSE=yes %{_mandir}/man1/pcre2test.* %changelog +* Fri Feb 19 2021 Petr Pisar - 10.36-4 +- Fix a mismatch if \K was involved in a recursion +- Restore single character repetition optimization in JIT (upstream bug #2698) + * Tue Feb 02 2021 Petr Pisar - 10.36-3 - Fix misparsing long numbers as a backreference and a number without a closing bracket as a quantifier (upstream bug #2690)