diff --git a/pcre-8.37-Fix-compile-bug-for-classes-like-W-p-Any.patch b/pcre-8.37-Fix-compile-bug-for-classes-like-W-p-Any.patch new file mode 100644 index 0000000..b30e055 --- /dev/null +++ b/pcre-8.37-Fix-compile-bug-for-classes-like-W-p-Any.patch @@ -0,0 +1,91 @@ +From 7b67e393f64afd69c48e585d3e4291d7d1b3a0f5 Mon Sep 17 00:00:00 2001 +From: ph10 +Date: Fri, 9 Oct 2015 16:11:18 +0000 +Subject: [PATCH] Fix compile bug for classes like [\W\p{Any}]. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1601 2f5784b3-3f2a-0410-8824-cb99058d5e15 +Signed-off-by: Petr Písař + +Petr Pisar: Ported to 8.37. +--- + pcre_compile.c | 5 +++-- + testdata/testinput5 | 9 +++++++++ + testdata/testoutput5 | 26 ++++++++++++++++++++++++++ + 4 files changed, 42 insertions(+), 2 deletions(-) + +diff --git a/pcre_compile.c b/pcre_compile.c +index 191330a..f8ce576 100644 +--- a/pcre_compile.c ++++ b/pcre_compile.c +@@ -5512,9 +5512,10 @@ for (;; ptr++) + actual compiled code. */ + + #ifdef SUPPORT_UTF +- if (xclass && (!should_flip_negation || (options & PCRE_UCP) != 0)) ++ if (xclass && (xclass_has_prop || !should_flip_negation || ++ (options & PCRE_UCP) != 0)) + #elif !defined COMPILE_PCRE8 +- if (xclass && !should_flip_negation) ++ if (xclass && (xclass_has_prop || !should_flip_negation)) + #endif + #if defined SUPPORT_UTF || !defined COMPILE_PCRE8 + { +diff --git a/testdata/testinput5 b/testdata/testinput5 +index 28561a9..c825ca2 100644 +--- a/testdata/testinput5 ++++ b/testdata/testinput5 +@@ -798,4 +798,13 @@ + /(?<=\K\x{17f})/8G+ + \x{17f}\x{17f}\x{17f}\x{17f}\x{17f} + ++/[\W\p{Any}]/BZ ++ abc ++ 123 ++ ++/[\W\pL]/BZ ++ abc ++ ** Failers ++ 123 ++ + /-- End of testinput5 --/ +diff --git a/testdata/testoutput5 b/testdata/testoutput5 +index bab989c..42e5e16 100644 +--- a/testdata/testoutput5 ++++ b/testdata/testoutput5 +@@ -1942,4 +1942,30 @@ Need char = 'z' + 0: \x{17f} + 0+ + ++/[\W\p{Any}]/BZ ++------------------------------------------------------------------ ++ Bra ++ [\x00-/:-@[-^`{-\xff\p{Any}] ++ Ket ++ End ++------------------------------------------------------------------ ++ abc ++ 0: a ++ 123 ++ 0: 1 ++ ++/[\W\pL]/BZ ++------------------------------------------------------------------ ++ Bra ++ [\x00-/:-@[-^`{-\xff\p{L}] ++ Ket ++ End ++------------------------------------------------------------------ ++ abc ++ 0: a ++ ** Failers ++ 0: * ++ 123 ++No match ++ + /-- End of testinput5 --/ +-- +2.4.3 + diff --git a/pcre.spec b/pcre.spec index 2a143d3..1810dac 100644 --- a/pcre.spec +++ b/pcre.spec @@ -2,7 +2,7 @@ #%%global rcversion RC1 Name: pcre Version: 8.37 -Release: %{?rcversion:0.}4%{?rcversion:.%rcversion}%{?dist} +Release: %{?rcversion:0.}5%{?rcversion:.%rcversion}%{?dist} %global myversion %{version}%{?rcversion:-%rcversion} Summary: Perl-compatible regular expression library Group: System Environment/Libraries @@ -49,6 +49,9 @@ Patch6: pcre-8.37-Fix-buffer-overflow-for-named-references-in-situatio.patch # , bug #1256452, # in upstream after 8.37 Patch7: pcre-8.37-Hack-in-yet-other-patch-for-a-bug-in-size-computatio.patch +# Fix compiling classes with a negative escape and a property escape, +# upstream bug #1697, fixed in upstream after 8.37. +Patch8: pcre-8.37-Fix-compile-bug-for-classes-like-W-p-Any.patch BuildRequires: readline-devel # New libtool to get rid of rpath BuildRequires: autoconf, automake, libtool @@ -96,6 +99,7 @@ Utilities demonstrating PCRE capabilities like pcregrep or pcretest. %patch5 -p1 %patch6 -p1 %patch7 -p1 +%patch8 -p1 # Because of rpath patch libtoolize --copy --force && autoreconf -vif # One contributor's name is non-UTF-8 @@ -166,6 +170,10 @@ make %{?_smp_mflags} check VERBOSE=yes %{_mandir}/man1/pcretest.* %changelog +* Mon Oct 12 2015 Petr Pisar - 8.37-5 +- Fix compiling classes with a negative escape and a property escape + (upstream bug #1697) + * Tue Aug 25 2015 Petr Pisar - 8.37-4 - Fix a heap overflow when compiling certain expression with named references (bug #1256452)