ppisar pushed to pcre (master). "Fix compilation of a pattern with mutual recursion nested inside other group"

notifications at fedoraproject.org notifications at fedoraproject.org
Fri Apr 10 06:49:59 UTC 2015


>From 07d112eaa670d857f7f996e54a11e7648120a3f8 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 1b78ec3..746b957 100644
--- a/pcre.spec
+++ b/pcre.spec
@@ -25,6 +25,9 @@ Patch4: pcre-8.36-Remove-computing-the-JIT-read-only-data-size-in-adva.patch
 # Fix computing size for pattern with a negated special calss in on-UCP mode,
 # bug #1210383, in upstream after 8.36
 Patch5: 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
+Patch6: 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
@@ -70,6 +73,7 @@ Utilities demonstrating PCRE capabilities like pcregrep or pcretest.
 %patch3 -p1 -b .zero_repeat_assertion
 %patch4 -p1 -b .jit_size
 %patch5 -p1 -b .size_special_class
+%patch6 -p1 -b .mutual_recursion
 # Because of rpath patch
 libtoolize --copy --force && autoreconf -vif
 # One contributor's name is non-UTF-8
@@ -143,6 +147,8 @@ make %{?_smp_mflags} check VERBOSE=yes
 * Thu Apr 09 2015 Petr Pisar <ppisar at redhat.com> - 8.36-5
 - 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 Mar 26 2015 Petr Pisar <ppisar at redhat.com> - 8.36-4
 - Fix computing size of JIT read-only data (bug #1206131)
-- 
cgit v0.10.2


	http://pkgs.fedoraproject.org/cgit/pcre.git/commit/?h=master&id=07d112eaa670d857f7f996e54a11e7648120a3f8


More information about the scm-commits mailing list