From 95dcb8d3c2a4737cca58ba65c2acf7e1750090fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= Date: Thu, 31 Jan 2019 11:56:59 +0100 Subject: [PATCH] Fix version conditions in DFA engine --- ...ION-conditional-test-in-DFA-matching.patch | 77 +++++++++++++++++++ pcre2.spec | 9 ++- 2 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 pcre2-10.32-Fix-bug-in-VERSION-conditional-test-in-DFA-matching.patch diff --git a/pcre2-10.32-Fix-bug-in-VERSION-conditional-test-in-DFA-matching.patch b/pcre2-10.32-Fix-bug-in-VERSION-conditional-test-in-DFA-matching.patch new file mode 100644 index 0000000..674ddfb --- /dev/null +++ b/pcre2-10.32-Fix-bug-in-VERSION-conditional-test-in-DFA-matching.patch @@ -0,0 +1,77 @@ +From 225bd60220208b0908555701a0176b8a9561dbe0 Mon Sep 17 00:00:00 2001 +From: ph10 +Date: Tue, 29 Jan 2019 14:34:59 +0000 +Subject: [PATCH] Fix bug in VERSION conditional test in DFA matching. +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@1062 6239d852-aaf2-0410-a92c-79f79f948069 + +Petr Písař: Ported to 10.32. + +Signed-off-by: Petr Písař +--- + src/pcre2_dfa_match.c | 2 +- + testdata/testinput6 | 10 ++++++++++ + testdata/testoutput6 | 14 ++++++++++++++ + 3 files changed, 25 insertions(+), 1 deletion(-) + +diff --git a/src/pcre2_dfa_match.c b/src/pcre2_dfa_match.c +index 818004d..1a7f19d 100644 +--- a/src/pcre2_dfa_match.c ++++ b/src/pcre2_dfa_match.c +@@ -2757,7 +2757,7 @@ for (;;) + /* There is also an always-true condition */ + + else if (condcode == OP_TRUE) +- { ADD_ACTIVE(state_offset + LINK_SIZE + 2 + IMM2_SIZE, 0); } ++ { ADD_ACTIVE(state_offset + LINK_SIZE + 2, 0); } + + /* The only supported version of OP_RREF is for the value RREF_ANY, + which means "test if in any recursion". We can't test for specifically +diff --git a/testdata/testinput6 b/testdata/testinput6 +index f7dedb2..684e029 100644 +--- a/testdata/testinput6 ++++ b/testdata/testinput6 +@@ -4955,4 +4955,14 @@ + \= Expect no match + \na + ++/(?(VERSION>=0)^B0W)/ ++ B0W-W0W ++\= Expect no match ++ 0 ++ ++/(?(VERSION>=1000)^B0W|W0W)/ ++ B0W-W0W ++\= Expect no match ++ 0 ++ + # End of testinput6 +diff --git a/testdata/testoutput6 b/testdata/testoutput6 +index caec833..051248f 100644 +--- a/testdata/testoutput6 ++++ b/testdata/testoutput6 +@@ -7783,4 +7783,18 @@ No match + \na + No match + ++/(?(VERSION>=0)^B0W)/ ++ B0W-W0W ++ 0: B0W ++\= Expect no match ++ 0 ++No match ++ ++/(?(VERSION>=1000)^B0W|W0W)/ ++ B0W-W0W ++ 0: W0W ++\= Expect no match ++ 0 ++No match ++ + # End of testinput6 +-- +2.17.2 + diff --git a/pcre2.spec b/pcre2.spec index 87aeb83..f4c1113 100644 --- a/pcre2.spec +++ b/pcre2.spec @@ -9,7 +9,7 @@ #%%global rcversion RC1 Name: pcre2 Version: 10.32 -Release: %{?rcversion:0.}6%{?rcversion:.%rcversion}%{?dist} +Release: %{?rcversion:0.}7%{?rcversion:.%rcversion}%{?dist} %global myversion %{version}%{?rcversion:-%rcversion} Summary: Perl-compatible regular expression library # the library: BSD with exceptions @@ -74,6 +74,9 @@ Patch7: pcre2-10.32-Provide-alternative-POSIX-names.patch # Link applications to PCRE2-specific symbols when using POSIX API, bug #1667614, # upstream bug 1830, proposed to upstream Patch8: pcre2-10.32-Declare-POSIX-regex-function-names-as-macros-to-PCRE.patch +# Fix version conditions in DFA engine, upstream bug #2367, +# in upstream after 10.32 +Patch9: pcre2-10.32-Fix-bug-in-VERSION-conditional-test-in-DFA-matching.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: coreutils @@ -158,6 +161,7 @@ Utilities demonstrating PCRE2 capabilities like pcre2grep or pcre2test. %patch6 -p1 %patch7 -p1 %patch8 -p1 +%patch9 -p1 # Because of multilib patch libtoolize --copy --force autoreconf -vif @@ -259,6 +263,9 @@ make %{?_smp_mflags} check VERBOSE=yes %{_mandir}/man1/pcre2test.* %changelog +* Thu Jan 31 2019 Petr Pisar - 10.32-7 +- Fix version conditions in DFA engine (upstream bug #2367) + * Tue Jan 22 2019 Petr Pisar - 10.32-6 - Link applications to PCRE2-specific symbols when using POSIX API (bug #1667614)