From 64eff980f811236cd7f36e414823e05ca9833f1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= Date: Mon, 12 Aug 2019 14:25:22 +0200 Subject: [PATCH] Fix reporting rightmost consulted characters --- ...bug-rightmost-consulted-character-in.patch | 89 +++++++++++++++++++ pcre2.spec | 8 +- 2 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 pcre2-10.33-Fix-allusedtext-bug-rightmost-consulted-character-in.patch diff --git a/pcre2-10.33-Fix-allusedtext-bug-rightmost-consulted-character-in.patch b/pcre2-10.33-Fix-allusedtext-bug-rightmost-consulted-character-in.patch new file mode 100644 index 0000000..3b0bd76 --- /dev/null +++ b/pcre2-10.33-Fix-allusedtext-bug-rightmost-consulted-character-in.patch @@ -0,0 +1,89 @@ +From ec098f6b898334be0674dbadc9fd67a0532fa0eb Mon Sep 17 00:00:00 2001 +From: ph10 +Date: Sat, 10 Aug 2019 11:34:50 +0000 +Subject: [PATCH] Fix allusedtext bug, rightmost consulted character incorrect + in negative lookaheads. +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@1157 6239d852-aaf2-0410-a92c-79f79f948069 +Petr Písař: Ported to 10.33. +--- + src/pcre2_match.c | 1 + + testdata/testinput15 | 4 ++++ + testdata/testinput2 | 2 +- + testdata/testoutput15 | 8 ++++++++ + testdata/testoutput2 | 2 +- + +diff --git a/src/pcre2_match.c b/src/pcre2_match.c +index 26fc01e..4471183 100644 +--- a/src/pcre2_match.c ++++ b/src/pcre2_match.c +@@ -5971,6 +5971,7 @@ in rrc. */ + #define LBL(val) case val: goto L_RM##val; + + RETURN_SWITCH: ++if (Feptr > mb->last_used_ptr) mb->last_used_ptr = Feptr; + if (Frdepth == 0) return rrc; /* Exit from the top level */ + F = (heapframe *)((char *)F - Fback_frame); /* Backtrack */ + mb->cb->callout_flags |= PCRE2_CALLOUT_BACKTRACK; /* Note for callouts */ +diff --git a/testdata/testinput15 b/testdata/testinput15 +index 2cb712d..5dd6897 100644 +--- a/testdata/testinput15 ++++ b/testdata/testinput15 +@@ -231,4 +231,8 @@ + /(*LIMIT_HEAP=21)\[(a)]{60}/expand + \[a]{60} + ++/b(? ++ abcz ++ 0: abcz ++ < >> ++ + # End of testinput15 +diff --git a/testdata/testoutput2 b/testdata/testoutput2 +index 0fd2187..0803d9e 100644 +--- a/testdata/testoutput2 ++++ b/testdata/testoutput2 +@@ -14803,7 +14803,7 @@ No match + /abcd/null_context + abcd\=null_context + 0: abcd +-\= Expect error ++\= Expect error - not allowed together + abcd\=null_context,find_limits + ** Not allowed together: find_limits null_context + abcd\=allusedtext,startchar +-- +2.21.0 + diff --git a/pcre2.spec b/pcre2.spec index a9f35ed..43a2fd4 100644 --- a/pcre2.spec +++ b/pcre2.spec @@ -9,7 +9,7 @@ #%%global rcversion RC1 Name: pcre2 Version: 10.33 -Release: %{?rcversion:0.}10%{?rcversion:.%rcversion}%{?dist} +Release: %{?rcversion:0.}11%{?rcversion:.%rcversion}%{?dist} %global myversion %{version}%{?rcversion:-%rcversion} Summary: Perl-compatible regular expression library # the library: BSD with exceptions @@ -88,6 +88,8 @@ Patch12: pcre2-10.33-Fix-bug-in-recent-patch-for-lookbehinds-within-looka.pat # Fix an incorrect computation of a group length when a branch exceeds 65535, # upstream bug #2428, in upstream after 10.33 Patch13: pcre2-10.33-Fix-incorrect-computation-of-group-length-when-one-b.patch +# Fix reporting rightmost consulted characters, in upstream after 10.33 +Patch14: pcre2-10.33-Fix-allusedtext-bug-rightmost-consulted-character-in.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: coreutils @@ -179,6 +181,7 @@ Utilities demonstrating PCRE2 capabilities like pcre2grep or pcre2test. %patch11 -p1 %patch12 -p1 %patch13 -p1 +%patch14 -p1 # Because of multilib patch libtoolize --copy --force autoreconf -vif @@ -277,6 +280,9 @@ make %{?_smp_mflags} check VERBOSE=yes %{_mandir}/man1/pcre2test.* %changelog +* Mon Aug 12 2019 Petr Pisar - 10.33-11 +- Fix reporting rightmost consulted characters + * Mon Aug 05 2019 Petr Pisar - 10.33-10 - Fix an incorrect computation of a group length when a branch exceeds 65535 (upstream bug #2428)