ppisar pushed to pcre (f21). "Fix compilation of a pattern with mutual recursion nested inside other group"
notifications at fedoraproject.org
notifications at fedoraproject.org
Fri Apr 10 08:06:22 UTC 2015
>From 6d1451860bd06ae600785ee1b7eee2ee95c67861 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar at redhat.com>
Date: Thu, 9 Apr 2015 17:24:44 +0200
Subject: Fix compilation of a pattern with mutual recursion nested inside
other group
diff --git a/pcre-8.36-Fix-mutual-recursion-inside-other-groups-stack-overf.patch b/pcre-8.36-Fix-mutual-recursion-inside-other-groups-stack-overf.patch
new file mode 100644
index 0000000..d5d7237
--- /dev/null
+++ b/pcre-8.36-Fix-mutual-recursion-inside-other-groups-stack-overf.patch
@@ -0,0 +1,60 @@
+From 9ddce66fd62671186bcd66b1aa72e31cba135c26 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar at redhat.com>
+Date: Thu, 9 Apr 2015 17:23:38 +0200
+Subject: [PATCH] Fix mutual recursion inside other groups stack overflow bug.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Upstream commit ported to 8.36:
+
+commit e97ec7dc839022a3efe740c532ea3e67e4446430
+Author: ph10 <ph10 at 2f5784b3-3f2a-0410-8824-cb99058d5e15>
+Date: Fri Mar 27 17:48:28 2015 +0000
+
+ Fix mutual recursion inside other groups stack overflow bug.
+
+ git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1537 2f5784b3-3f2a-0410-8824-cb99058d5e15
+
+Signed-off-by: Petr Písař <ppisar at redhat.com>
+
+diff --git a/pcre_compile.c b/pcre_compile.c
+index c256ea5..ce187cd 100644
+--- a/pcre_compile.c
++++ b/pcre_compile.c
+@@ -2469,8 +2469,8 @@ for (code = first_significant_code(code + PRIV(OP_lengths)[*code], TRUE);
+ empty_branch = FALSE;
+ do
+ {
+- if (!empty_branch && could_be_empty_branch(code, endcode, utf, cd, NULL))
+- empty_branch = TRUE;
++ if (!empty_branch && could_be_empty_branch(code, endcode, utf, cd,
++ recurses)) empty_branch = TRUE;
+ code += GET(code, 1);
+ }
+ while (*code == OP_ALT);
+diff --git a/testdata/testinput2 b/testdata/testinput2
+index 015422e..c01a094 100644
+--- a/testdata/testinput2
++++ b/testdata/testinput2
+@@ -4084,4 +4084,6 @@ backtracking verbs. --/
+ "(?(?=)?==)(((((((((?=)))))))))"
+ a
+
++"((?2)+)((?1))"
++
+ /-- End of testinput2 --/
+diff --git a/testdata/testoutput2 b/testdata/testoutput2
+index 9a1b14e..0118730 100644
+--- a/testdata/testoutput2
++++ b/testdata/testoutput2
+@@ -14216,4 +14216,6 @@ Failed: non-hex character in \x{} (closing brace missing?) at offset 3
+ a
+ No match
+
++"((?2)+)((?1))"
++
+ /-- End of testinput2 --/
+--
+2.1.0
+
diff --git a/pcre.spec b/pcre.spec
index 5b6433a..8278f48 100644
--- a/pcre.spec
+++ b/pcre.spec
@@ -47,6 +47,9 @@ Patch11: pcre-8.35-Fix-zero-repeat-assertion-condition-bug.patch
# Fix computing size for pattern with a negated special calss in on-UCP mode,
# bug #1210383, in upstream after 8.36
Patch12: pcre-8.36-Fix-memory-bug-for-S-V-H-compile.patch
+# Fix compilation of a pattern with mutual recursion nested inside other group,
+# bug #1210393, in upstream after 8.36
+Patch13: pcre-8.36-Fix-mutual-recursion-inside-other-groups-stack-overf.patch
BuildRequires: readline-devel
# New libtool to get rid of rpath
BuildRequires: autoconf, automake, libtool
@@ -99,6 +102,7 @@ Utilities demonstrating PCRE capabilities like pcregrep or pcretest.
%patch10 -p1 -b .reset_groups
%patch11 -p1 -b .zero_repeat_assertion
%patch12 -p1 -b .size_special_class
+%patch13 -p1 -b .mutual_recursion
# Because of rpath patch
libtoolize --copy --force && autoreconf -vif
# One contributor's name is non-UTF-8
@@ -172,6 +176,8 @@ make %{?_smp_mflags} check
* Fri Apr 10 2015 Petr Pisar <ppisar at redhat.com> - 8.35-9
- Fix computing size for pattern with a negated special calss in on-UCP mode
(bug #1210383)
+- Fix compilation of a pattern with mutual recursion nested inside other group
+ (bug #1210393)
* Thu Nov 20 2014 Petr Pisar <ppisar at redhat.com> - 8.35-8
- Fix CVE-2014-8964 (unused memory usage on zero-repeat assertion condition)
--
cgit v0.10.2
http://pkgs.fedoraproject.org/cgit/pcre.git/commit/?h=f21&id=6d1451860bd06ae600785ee1b7eee2ee95c67861
More information about the scm-commits
mailing list