Blame SOURCES/pcre-8.32-Fix-zero-repeat-assertion-condition-bug.patch

b8498e
From e2d6b400b13cde3cffc1933208399c223459b3ba Mon Sep 17 00:00:00 2001
b8498e
From: ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>
b8498e
Date: Wed, 19 Nov 2014 20:57:13 +0000
b8498e
Subject: [PATCH] Fix zero-repeat assertion condition bug.
b8498e
MIME-Version: 1.0
b8498e
Content-Type: text/plain; charset=UTF-8
b8498e
Content-Transfer-Encoding: 8bit
b8498e
b8498e
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1513 2f5784b3-3f2a-0410-8824-cb99058d5e15
b8498e
Signed-off-by: Petr Písař <ppisar@redhat.com>
b8498e
b8498e
Petr Pisar: Ported to 8.32.
b8498e
b8498e
Signed-off-by: Petr Písař <ppisar@redhat.com>
b8498e
---
b8498e
 pcre_exec.c          |  4 +++-
b8498e
 testdata/testinput2  |  6 ++++++
b8498e
 testdata/testoutput2 | 10 ++++++++++
b8498e
 3 files changed, 19 insertions(+), 1 deletion(-)
b8498e
b8498e
diff --git a/pcre_exec.c b/pcre_exec.c
b8498e
index 05d0e52..a5326dc 100644
b8498e
--- a/pcre_exec.c
b8498e
+++ b/pcre_exec.c
b8498e
@@ -1459,7 +1459,9 @@ for (;;)
b8498e
         if (md->end_offset_top > offset_top)
b8498e
           offset_top = md->end_offset_top;  /* Captures may have happened */
b8498e
         condition = TRUE;
b8498e
-        ecode += 1 + LINK_SIZE + GET(ecode, LINK_SIZE + 2);
b8498e
+        ecode += 1 + LINK_SIZE;
b8498e
+        if (*ecode == OP_BRAZERO) ecode++;
b8498e
+        ecode += GET(ecode, 1);
b8498e
         while (*ecode == OP_ALT) ecode += GET(ecode, 1);
b8498e
         }
b8498e
 
b8498e
diff --git a/testdata/testinput2 b/testdata/testinput2
b8498e
index 9670104..0835a98 100644
b8498e
--- a/testdata/testinput2
b8498e
+++ b/testdata/testinput2
b8498e
@@ -3810,4 +3810,10 @@ settings of the anchored and startline bits. --/
b8498e
 
b8498e
 /.?/S!I
b8498e
 
b8498e
+"((?=(?(?=(?(?=(?(?=())))*)))))"
b8498e
+    a
b8498e
+
b8498e
+"(?(?=)?==)(((((((((?=)))))))))"
b8498e
+    a
b8498e
+
b8498e
 /-- End of testinput2 --/
b8498e
diff --git a/testdata/testoutput2 b/testdata/testoutput2
b8498e
index e9cddf8..66c914f 100644
b8498e
--- a/testdata/testoutput2
b8498e
+++ b/testdata/testoutput2
b8498e
@@ -12481,4 +12481,14 @@ No need char
b8498e
 Subject length lower bound = -1
b8498e
 No set of starting bytes
b8498e
 
b8498e
+"((?=(?(?=(?(?=(?(?=())))*)))))"
b8498e
+    a
b8498e
+ 0: 
b8498e
+ 1: 
b8498e
+ 2: 
b8498e
+
b8498e
+"(?(?=)?==)(((((((((?=)))))))))"
b8498e
+    a
b8498e
+No match
b8498e
+
b8498e
 /-- End of testinput2 --/
b8498e
-- 
b8498e
1.9.3
b8498e