8.36 RC1 bump
This commit is contained in:
parent
e169761f61
commit
0f2b23bfa3
1
.gitignore
vendored
1
.gitignore
vendored
@ -18,3 +18,4 @@ pcre-8.10.tar.bz2
|
||||
/pcre-8.34.tar.bz2
|
||||
/pcre-8.35-RC1.tar.bz2
|
||||
/pcre-8.35.tar.bz2
|
||||
/pcre-8.36-RC1.tar.bz2
|
||||
|
@ -1,64 +0,0 @@
|
||||
From a05e11ff3a663c06e0a30dfa86aa7ed4544a6008 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
||||
Date: Fri, 11 Apr 2014 13:41:13 +0200
|
||||
Subject: [PATCH] Do not rely on wrapping signed integer while parseing
|
||||
{min,max}
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Signed integer overflow is not defined in C language. GCC 4.9 bails
|
||||
out here.
|
||||
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
pcre_compile.c | 24 ++++++++++++++++--------
|
||||
1 file changed, 16 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/pcre_compile.c b/pcre_compile.c
|
||||
index 8a5b723..ce65058 100644
|
||||
--- a/pcre_compile.c
|
||||
+++ b/pcre_compile.c
|
||||
@@ -1586,11 +1586,15 @@ int max = -1;
|
||||
/* Read the minimum value and do a paranoid check: a negative value indicates
|
||||
an integer overflow. */
|
||||
|
||||
-while (IS_DIGIT(*p)) min = min * 10 + (int)(*p++ - CHAR_0);
|
||||
-if (min < 0 || min > 65535)
|
||||
+while (IS_DIGIT(*p))
|
||||
{
|
||||
- *errorcodeptr = ERR5;
|
||||
- return p;
|
||||
+ min = min * 10 + (int)(*p++ - CHAR_0);
|
||||
+ if (min > 65535)
|
||||
+ {
|
||||
+ *errorcodeptr = ERR5;
|
||||
+ while (*p != CHAR_RIGHT_CURLY_BRACKET) p++;
|
||||
+ return p;
|
||||
+ }
|
||||
}
|
||||
|
||||
/* Read the maximum value if there is one, and again do a paranoid on its size.
|
||||
@@ -1601,11 +1605,15 @@ if (*p == CHAR_RIGHT_CURLY_BRACKET) max = min; else
|
||||
if (*(++p) != CHAR_RIGHT_CURLY_BRACKET)
|
||||
{
|
||||
max = 0;
|
||||
- while(IS_DIGIT(*p)) max = max * 10 + (int)(*p++ - CHAR_0);
|
||||
- if (max < 0 || max > 65535)
|
||||
+ while(IS_DIGIT(*p))
|
||||
{
|
||||
- *errorcodeptr = ERR5;
|
||||
- return p;
|
||||
+ max = max * 10 + (int)(*p++ - CHAR_0);
|
||||
+ if (max > 65535)
|
||||
+ {
|
||||
+ *errorcodeptr = ERR5;
|
||||
+ while (*p != CHAR_RIGHT_CURLY_BRACKET) p++;
|
||||
+ return p;
|
||||
+ }
|
||||
}
|
||||
if (max < min)
|
||||
{
|
||||
--
|
||||
1.9.0
|
||||
|
@ -1,61 +0,0 @@
|
||||
From 8d8c3dbadff3d0735ba696acf211c14b3025622f Mon Sep 17 00:00:00 2001
|
||||
From: ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>
|
||||
Date: Wed, 18 Jun 2014 17:17:03 +0000
|
||||
Subject: [PATCH] Fix bad compile of [\Qx]... where x is any character.
|
||||
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@1487 2f5784b3-3f2a-0410-8824-cb99058d5e15
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
|
||||
Petr Pisar: Ported to 8.35.
|
||||
|
||||
diff --git a/pcre_compile.c b/pcre_compile.c
|
||||
index 29d3c29..c44839e 100644
|
||||
--- a/pcre_compile.c
|
||||
+++ b/pcre_compile.c
|
||||
@@ -5325,7 +5325,7 @@ for (;; ptr++)
|
||||
whatever repeat count may follow. In the case of reqchar, save the
|
||||
previous value for reinstating. */
|
||||
|
||||
- if (class_one_char == 1 && ptr[1] == CHAR_RIGHT_SQUARE_BRACKET)
|
||||
+ if (!inescq && class_one_char == 1 && ptr[1] == CHAR_RIGHT_SQUARE_BRACKET)
|
||||
{
|
||||
ptr++;
|
||||
zeroreqchar = reqchar;
|
||||
diff --git a/testdata/testinput1 b/testdata/testinput1
|
||||
index c9ebf9f..5513d16 100644
|
||||
--- a/testdata/testinput1
|
||||
+++ b/testdata/testinput1
|
||||
@@ -5708,4 +5708,10 @@ AbcdCBefgBhiBqz
|
||||
/\sabc/
|
||||
\x{0b}abc
|
||||
|
||||
+/[\Qa]\E]+/
|
||||
+ aa]]
|
||||
+
|
||||
+/[\Q]a\E]+/
|
||||
+ aa]]
|
||||
+
|
||||
/-- End of testinput1 --/
|
||||
diff --git a/testdata/testoutput1 b/testdata/testoutput1
|
||||
index 6eb7d2d..cfa90d6 100644
|
||||
--- a/testdata/testoutput1
|
||||
+++ b/testdata/testoutput1
|
||||
@@ -9393,4 +9393,12 @@ No match
|
||||
\x{0b}abc
|
||||
0: \x0babc
|
||||
|
||||
+/[\Qa]\E]+/
|
||||
+ aa]]
|
||||
+ 0: aa]]
|
||||
+
|
||||
+/[\Q]a\E]+/
|
||||
+ aa]]
|
||||
+ 0: aa]]
|
||||
+
|
||||
/-- End of testinput1 --/
|
||||
--
|
||||
1.9.3
|
||||
|
@ -1,85 +0,0 @@
|
||||
From 35f4457ba4dadc0839df9275adf1fd14e15c28fa Mon Sep 17 00:00:00 2001
|
||||
From: ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>
|
||||
Date: Wed, 18 Jun 2014 16:31:32 +0000
|
||||
Subject: [PATCH] Fix bad starting data when char with more than one other case
|
||||
follows circumflex in multiline UTF mode.
|
||||
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@1485 2f5784b3-3f2a-0410-8824-cb99058d5e15
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
|
||||
Petr Pisar: Ported to 8.35.
|
||||
|
||||
diff --git a/pcre_compile.c b/pcre_compile.c
|
||||
index 0cf05b9..29d3c29 100644
|
||||
--- a/pcre_compile.c
|
||||
+++ b/pcre_compile.c
|
||||
@@ -4694,7 +4694,8 @@ for (;; ptr++)
|
||||
previous = NULL;
|
||||
if ((options & PCRE_MULTILINE) != 0)
|
||||
{
|
||||
- if (firstcharflags == REQ_UNSET) firstcharflags = REQ_NONE;
|
||||
+ if (firstcharflags == REQ_UNSET)
|
||||
+ zerofirstcharflags = firstcharflags = REQ_NONE;
|
||||
*code++ = OP_CIRCM;
|
||||
}
|
||||
else *code++ = OP_CIRC;
|
||||
diff --git a/testdata/testinput6 b/testdata/testinput6
|
||||
index 7a6a53f..7aebba0 100644
|
||||
--- a/testdata/testinput6
|
||||
+++ b/testdata/testinput6
|
||||
@@ -1493,4 +1493,7 @@
|
||||
/[q-u]+/8iW
|
||||
Ss\x{17f}
|
||||
|
||||
+/^s?c/mi8
|
||||
+ scat
|
||||
+
|
||||
/-- End of testinput6 --/
|
||||
diff --git a/testdata/testinput7 b/testdata/testinput7
|
||||
index 6bd0586..7a66025 100644
|
||||
--- a/testdata/testinput7
|
||||
+++ b/testdata/testinput7
|
||||
@@ -835,4 +835,7 @@ of case for anything other than the ASCII letters. --/
|
||||
|
||||
/[Q-U]+/8iWBZ
|
||||
|
||||
+/^s?c/mi8I
|
||||
+ scat
|
||||
+
|
||||
/-- End of testinput7 --/
|
||||
diff --git a/testdata/testoutput6 b/testdata/testoutput6
|
||||
index f355e60..65bf78f 100644
|
||||
--- a/testdata/testoutput6
|
||||
+++ b/testdata/testoutput6
|
||||
@@ -2457,4 +2457,8 @@ No match
|
||||
Ss\x{17f}
|
||||
0: Ss\x{17f}
|
||||
|
||||
+/^s?c/mi8
|
||||
+ scat
|
||||
+ 0: sc
|
||||
+
|
||||
/-- End of testinput6 --/
|
||||
diff --git a/testdata/testoutput7 b/testdata/testoutput7
|
||||
index c64e049..ee46bdb 100644
|
||||
--- a/testdata/testoutput7
|
||||
+++ b/testdata/testoutput7
|
||||
@@ -2287,4 +2287,12 @@ No match
|
||||
End
|
||||
------------------------------------------------------------------
|
||||
|
||||
+/^s?c/mi8I
|
||||
+Capturing subpattern count = 0
|
||||
+Options: caseless multiline utf
|
||||
+First char at start or follows newline
|
||||
+Need char = 'c' (caseless)
|
||||
+ scat
|
||||
+ 0: sc
|
||||
+
|
||||
/-- End of testinput7 --/
|
||||
--
|
||||
1.9.3
|
||||
|
@ -1,100 +0,0 @@
|
||||
From fd411b0b71fc1d0bd1977d0a86e5711599f875d8 Mon Sep 17 00:00:00 2001
|
||||
From: ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>
|
||||
Date: Fri, 8 Aug 2014 15:22:51 +0000
|
||||
Subject: [PATCH] Fix compile-time loop for recursive reference within a group
|
||||
with an indefinite repeat.
|
||||
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@1498 2f5784b3-3f2a-0410-8824-cb99058d5e15
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
|
||||
Petr Pisar: Ported to 8.35.
|
||||
|
||||
diff --git a/pcre_compile.c b/pcre_compile.c
|
||||
index 8276d0f..4bb05b9 100644
|
||||
--- a/pcre_compile.c
|
||||
+++ b/pcre_compile.c
|
||||
@@ -2374,6 +2374,7 @@ for (code = first_significant_code(code + PRIV(OP_lengths)[*code], TRUE);
|
||||
if (c == OP_RECURSE)
|
||||
{
|
||||
const pcre_uchar *scode = cd->start_code + GET(code, 1);
|
||||
+ const pcre_uchar *endgroup = scode;
|
||||
BOOL empty_branch;
|
||||
|
||||
/* Test for forward reference or uncompleted reference. This is disabled
|
||||
@@ -2388,24 +2389,20 @@ for (code = first_significant_code(code + PRIV(OP_lengths)[*code], TRUE);
|
||||
if (GET(scode, 1) == 0) return TRUE; /* Unclosed */
|
||||
}
|
||||
|
||||
- /* If we are scanning a completed pattern, there are no forward references
|
||||
- and all groups are complete. We need to detect whether this is a recursive
|
||||
- call, as otherwise there will be an infinite loop. If it is a recursion,
|
||||
- just skip over it. Simple recursions are easily detected. For mutual
|
||||
- recursions we keep a chain on the stack. */
|
||||
+ /* If the reference is to a completed group, we need to detect whether this
|
||||
+ is a recursive call, as otherwise there will be an infinite loop. If it is
|
||||
+ a recursion, just skip over it. Simple recursions are easily detected. For
|
||||
+ mutual recursions we keep a chain on the stack. */
|
||||
|
||||
+ do endgroup += GET(endgroup, 1); while (*endgroup == OP_ALT);
|
||||
+ if (code >= scode && code <= endgroup) continue; /* Simple recursion */
|
||||
else
|
||||
- {
|
||||
+ {
|
||||
recurse_check *r = recurses;
|
||||
- const pcre_uchar *endgroup = scode;
|
||||
-
|
||||
- do endgroup += GET(endgroup, 1); while (*endgroup == OP_ALT);
|
||||
- if (code >= scode && code <= endgroup) continue; /* Simple recursion */
|
||||
-
|
||||
for (r = recurses; r != NULL; r = r->prev)
|
||||
if (r->group == scode) break;
|
||||
if (r != NULL) continue; /* Mutual recursion */
|
||||
- }
|
||||
+ }
|
||||
|
||||
/* Completed reference; scan the referenced group, remembering it on the
|
||||
stack chain to detect mutual recursions. */
|
||||
diff --git a/testdata/testinput1 b/testdata/testinput1
|
||||
index 6fd62ba..123e3d3 100644
|
||||
--- a/testdata/testinput1
|
||||
+++ b/testdata/testinput1
|
||||
@@ -4937,6 +4937,12 @@ however, we need the complication for Perl. ---/
|
||||
|
||||
/((?(R1)a+|(?1)b))/
|
||||
aaaabcde
|
||||
+
|
||||
+/((?(R)a|(?1)))*/
|
||||
+ aaa
|
||||
+
|
||||
+/((?(R)a|(?1)))+/
|
||||
+ aaa
|
||||
|
||||
/a(*:any
|
||||
name)/K
|
||||
diff --git a/testdata/testoutput1 b/testdata/testoutput1
|
||||
index eeddf0f..5e71900 100644
|
||||
--- a/testdata/testoutput1
|
||||
+++ b/testdata/testoutput1
|
||||
@@ -8234,6 +8234,16 @@ MK: M
|
||||
aaaabcde
|
||||
0: aaaab
|
||||
1: aaaab
|
||||
+
|
||||
+/((?(R)a|(?1)))*/
|
||||
+ aaa
|
||||
+ 0: aaa
|
||||
+ 1: a
|
||||
+
|
||||
+/((?(R)a|(?1)))+/
|
||||
+ aaa
|
||||
+ 0: aaa
|
||||
+ 1: a
|
||||
|
||||
/a(*:any
|
||||
name)/K
|
||||
--
|
||||
1.9.3
|
||||
|
@ -1,197 +0,0 @@
|
||||
From d35a6c663d37e072f4a5440f281f62aa6dc42418 Mon Sep 17 00:00:00 2001
|
||||
From: ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>
|
||||
Date: Sat, 12 Jul 2014 18:22:54 +0000
|
||||
Subject: [PATCH] Fix compiler crash/misbehaviour for zero-repeated groups that
|
||||
include a recursive back reference.
|
||||
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@1495 2f5784b3-3f2a-0410-8824-cb99058d5e15
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
|
||||
Petr Pisar: Ported to 8.35.
|
||||
|
||||
diff --git a/pcre_compile.c b/pcre_compile.c
|
||||
index 85d0e94..8276d0f 100644
|
||||
--- a/pcre_compile.c
|
||||
+++ b/pcre_compile.c
|
||||
@@ -8267,12 +8267,16 @@ for (;;)
|
||||
|
||||
/* If it was a capturing subpattern, check to see if it contained any
|
||||
recursive back references. If so, we must wrap it in atomic brackets.
|
||||
- In any event, remove the block from the chain. */
|
||||
+ Because we are moving code along, we must ensure that any pending recursive
|
||||
+ references are updated. In any event, remove the block from the chain. */
|
||||
|
||||
if (capnumber > 0)
|
||||
{
|
||||
if (cd->open_caps->flag)
|
||||
{
|
||||
+ *code = OP_END;
|
||||
+ adjust_recurse(start_bracket, 1 + LINK_SIZE,
|
||||
+ (options & PCRE_UTF8) != 0, cd, cd->hwm);
|
||||
memmove(start_bracket + 1 + LINK_SIZE, start_bracket,
|
||||
IN_UCHARS(code - start_bracket));
|
||||
*start_bracket = OP_ONCE;
|
||||
diff --git a/testdata/testinput11 b/testdata/testinput11
|
||||
index 391ada7..7e8e542 100644
|
||||
--- a/testdata/testinput11
|
||||
+++ b/testdata/testinput11
|
||||
@@ -132,4 +132,6 @@ is required for these tests. --/
|
||||
|
||||
/abc(d|e)(*THEN)x(123(*THEN)4|567(b|q)(*THEN)xx)/B
|
||||
|
||||
+/(((a\2)|(a*)\g<-1>))*a?/B
|
||||
+
|
||||
/-- End of testinput11 --/
|
||||
diff --git a/testdata/testinput2 b/testdata/testinput2
|
||||
index 81be076..c6816bf 100644
|
||||
--- a/testdata/testinput2
|
||||
+++ b/testdata/testinput2
|
||||
@@ -4035,6 +4035,8 @@ backtracking verbs. --/
|
||||
|
||||
/(?(R&6yh)abc)/
|
||||
|
||||
+/(((a\2)|(a*)\g<-1>))*a?/BZ
|
||||
+
|
||||
/-- Test the ugly "start or end of word" compatibility syntax --/
|
||||
|
||||
/[[:<:]]red[[:>:]]/BZ
|
||||
diff --git a/testdata/testoutput11-16 b/testdata/testoutput11-16
|
||||
index f1ad888..a1db3f3 100644
|
||||
--- a/testdata/testoutput11-16
|
||||
+++ b/testdata/testoutput11-16
|
||||
@@ -709,4 +709,28 @@ Memory allocation (code space): 14
|
||||
62 End
|
||||
------------------------------------------------------------------
|
||||
|
||||
+/(((a\2)|(a*)\g<-1>))*a?/B
|
||||
+------------------------------------------------------------------
|
||||
+ 0 39 Bra
|
||||
+ 2 Brazero
|
||||
+ 3 32 SCBra 1
|
||||
+ 6 27 Once
|
||||
+ 8 12 CBra 2
|
||||
+ 11 7 CBra 3
|
||||
+ 14 a
|
||||
+ 16 \2
|
||||
+ 18 7 Ket
|
||||
+ 20 11 Alt
|
||||
+ 22 5 CBra 4
|
||||
+ 25 a*
|
||||
+ 27 5 Ket
|
||||
+ 29 22 Recurse
|
||||
+ 31 23 Ket
|
||||
+ 33 27 Ket
|
||||
+ 35 32 KetRmax
|
||||
+ 37 a?+
|
||||
+ 39 39 Ket
|
||||
+ 41 End
|
||||
+------------------------------------------------------------------
|
||||
+
|
||||
/-- End of testinput11 --/
|
||||
diff --git a/testdata/testoutput11-32 b/testdata/testoutput11-32
|
||||
index 266e55d..7b7b030 100644
|
||||
--- a/testdata/testoutput11-32
|
||||
+++ b/testdata/testoutput11-32
|
||||
@@ -709,4 +709,28 @@ Memory allocation (code space): 28
|
||||
62 End
|
||||
------------------------------------------------------------------
|
||||
|
||||
+/(((a\2)|(a*)\g<-1>))*a?/B
|
||||
+------------------------------------------------------------------
|
||||
+ 0 39 Bra
|
||||
+ 2 Brazero
|
||||
+ 3 32 SCBra 1
|
||||
+ 6 27 Once
|
||||
+ 8 12 CBra 2
|
||||
+ 11 7 CBra 3
|
||||
+ 14 a
|
||||
+ 16 \2
|
||||
+ 18 7 Ket
|
||||
+ 20 11 Alt
|
||||
+ 22 5 CBra 4
|
||||
+ 25 a*
|
||||
+ 27 5 Ket
|
||||
+ 29 22 Recurse
|
||||
+ 31 23 Ket
|
||||
+ 33 27 Ket
|
||||
+ 35 32 KetRmax
|
||||
+ 37 a?+
|
||||
+ 39 39 Ket
|
||||
+ 41 End
|
||||
+------------------------------------------------------------------
|
||||
+
|
||||
/-- End of testinput11 --/
|
||||
diff --git a/testdata/testoutput11-8 b/testdata/testoutput11-8
|
||||
index d4a2133..f5ec652 100644
|
||||
--- a/testdata/testoutput11-8
|
||||
+++ b/testdata/testoutput11-8
|
||||
@@ -709,4 +709,28 @@ Memory allocation (code space): 10
|
||||
76 End
|
||||
------------------------------------------------------------------
|
||||
|
||||
+/(((a\2)|(a*)\g<-1>))*a?/B
|
||||
+------------------------------------------------------------------
|
||||
+ 0 57 Bra
|
||||
+ 3 Brazero
|
||||
+ 4 48 SCBra 1
|
||||
+ 9 40 Once
|
||||
+ 12 18 CBra 2
|
||||
+ 17 10 CBra 3
|
||||
+ 22 a
|
||||
+ 24 \2
|
||||
+ 27 10 Ket
|
||||
+ 30 16 Alt
|
||||
+ 33 7 CBra 4
|
||||
+ 38 a*
|
||||
+ 40 7 Ket
|
||||
+ 43 33 Recurse
|
||||
+ 46 34 Ket
|
||||
+ 49 40 Ket
|
||||
+ 52 48 KetRmax
|
||||
+ 55 a?+
|
||||
+ 57 57 Ket
|
||||
+ 60 End
|
||||
+------------------------------------------------------------------
|
||||
+
|
||||
/-- End of testinput11 --/
|
||||
diff --git a/testdata/testoutput2 b/testdata/testoutput2
|
||||
index 114817a..1e87026 100644
|
||||
--- a/testdata/testoutput2
|
||||
+++ b/testdata/testoutput2
|
||||
@@ -14093,6 +14093,30 @@ Failed: malformed number or name after (?( at offset 4
|
||||
/(?(R&6yh)abc)/
|
||||
Failed: group name must start with a non-digit at offset 5
|
||||
|
||||
+/(((a\2)|(a*)\g<-1>))*a?/BZ
|
||||
+------------------------------------------------------------------
|
||||
+ Bra
|
||||
+ Brazero
|
||||
+ SCBra 1
|
||||
+ Once
|
||||
+ CBra 2
|
||||
+ CBra 3
|
||||
+ a
|
||||
+ \2
|
||||
+ Ket
|
||||
+ Alt
|
||||
+ CBra 4
|
||||
+ a*
|
||||
+ Ket
|
||||
+ Recurse
|
||||
+ Ket
|
||||
+ Ket
|
||||
+ KetRmax
|
||||
+ a?+
|
||||
+ Ket
|
||||
+ End
|
||||
+------------------------------------------------------------------
|
||||
+
|
||||
/-- Test the ugly "start or end of word" compatibility syntax --/
|
||||
|
||||
/[[:<:]]red[[:>:]]/BZ
|
||||
--
|
||||
1.9.3
|
||||
|
@ -1,192 +0,0 @@
|
||||
From 31152356367ef3cf3440c0431d2898f198e4dd18 Mon Sep 17 00:00:00 2001
|
||||
From: ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>
|
||||
Date: Tue, 27 May 2014 13:18:31 +0000
|
||||
Subject: [PATCH] Fix empty-matching possessive zero-repeat groups bug.
|
||||
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@1478 2f5784b3-3f2a-0410-8824-cb99058d5e15
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
|
||||
Petr Pisar: Ported to 8.35.
|
||||
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
pcre_exec.c | 43 +++++++++++++++++++++++++++----------------
|
||||
testdata/testinput1 | 9 +++++++++
|
||||
testdata/testinput8 | 6 ++++++
|
||||
testdata/testoutput1 | 12 ++++++++++++
|
||||
testdata/testoutput8 | 8 ++++++++
|
||||
5 files changed, 62 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/pcre_exec.c b/pcre_exec.c
|
||||
index 5dec992..5a8dbad 100644
|
||||
--- a/pcre_exec.c
|
||||
+++ b/pcre_exec.c
|
||||
@@ -1167,11 +1167,16 @@ for (;;)
|
||||
if (rrc == MATCH_KETRPOS)
|
||||
{
|
||||
offset_top = md->end_offset_top;
|
||||
- eptr = md->end_match_ptr;
|
||||
ecode = md->start_code + code_offset;
|
||||
save_capture_last = md->capture_last;
|
||||
matched_once = TRUE;
|
||||
mstart = md->start_match_ptr; /* In case \K changed it */
|
||||
+ if (eptr == md->end_match_ptr) /* Matched an empty string */
|
||||
+ {
|
||||
+ do ecode += GET(ecode, 1); while (*ecode == OP_ALT);
|
||||
+ break;
|
||||
+ }
|
||||
+ eptr = md->end_match_ptr;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1241,10 +1246,15 @@ for (;;)
|
||||
if (rrc == MATCH_KETRPOS)
|
||||
{
|
||||
offset_top = md->end_offset_top;
|
||||
- eptr = md->end_match_ptr;
|
||||
ecode = md->start_code + code_offset;
|
||||
matched_once = TRUE;
|
||||
mstart = md->start_match_ptr; /* In case \K reset it */
|
||||
+ if (eptr == md->end_match_ptr) /* Matched an empty string */
|
||||
+ {
|
||||
+ do ecode += GET(ecode, 1); while (*ecode == OP_ALT);
|
||||
+ break;
|
||||
+ }
|
||||
+ eptr = md->end_match_ptr;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1894,7 +1904,7 @@ for (;;)
|
||||
case OP_KETRMAX:
|
||||
case OP_KETRPOS:
|
||||
prev = ecode - GET(ecode, 1);
|
||||
-
|
||||
+
|
||||
/* If this was a group that remembered the subject start, in order to break
|
||||
infinite repeats of empty string matches, retrieve the subject start from
|
||||
the chain. Otherwise, set it NULL. */
|
||||
@@ -1919,7 +1929,7 @@ for (;;)
|
||||
md->start_match_ptr = mstart;
|
||||
RRETURN(MATCH_MATCH); /* Sets md->mark */
|
||||
}
|
||||
-
|
||||
+
|
||||
/* For capturing groups we have to check the group number back at the start
|
||||
and if necessary complete handling an extraction by setting the offsets and
|
||||
bumping the high water mark. Whole-pattern recursion is coded as a recurse
|
||||
@@ -1979,6 +1989,19 @@ for (;;)
|
||||
}
|
||||
}
|
||||
|
||||
+ /* OP_KETRPOS is a possessive repeating ket. Remember the current position,
|
||||
+ and return the MATCH_KETRPOS. This makes it possible to do the repeats one
|
||||
+ at a time from the outer level, thus saving stack. This must precede the
|
||||
+ empty string test - in this case that test is done at the outer level. */
|
||||
+
|
||||
+ if (*ecode == OP_KETRPOS)
|
||||
+ {
|
||||
+ md->start_match_ptr = mstart; /* In case \K reset it */
|
||||
+ md->end_match_ptr = eptr;
|
||||
+ md->end_offset_top = offset_top;
|
||||
+ RRETURN(MATCH_KETRPOS);
|
||||
+ }
|
||||
+
|
||||
/* For an ordinary non-repeating ket, just continue at this level. This
|
||||
also happens for a repeating ket if no characters were matched in the
|
||||
group. This is the forcible breaking of infinite loops as implemented in
|
||||
@@ -2001,18 +2024,6 @@ for (;;)
|
||||
break;
|
||||
}
|
||||
|
||||
- /* OP_KETRPOS is a possessive repeating ket. Remember the current position,
|
||||
- and return the MATCH_KETRPOS. This makes it possible to do the repeats one
|
||||
- at a time from the outer level, thus saving stack. */
|
||||
-
|
||||
- if (*ecode == OP_KETRPOS)
|
||||
- {
|
||||
- md->start_match_ptr = mstart; /* In case \K reset it */
|
||||
- md->end_match_ptr = eptr;
|
||||
- md->end_offset_top = offset_top;
|
||||
- RRETURN(MATCH_KETRPOS);
|
||||
- }
|
||||
-
|
||||
/* The normal repeating kets try the rest of the pattern or restart from
|
||||
the preceding bracket, in the appropriate order. In the second case, we can
|
||||
use tail recursion to avoid using another stack frame, unless we have an
|
||||
diff --git a/testdata/testinput1 b/testdata/testinput1
|
||||
index f933692..ffb9455 100644
|
||||
--- a/testdata/testinput1
|
||||
+++ b/testdata/testinput1
|
||||
@@ -5675,4 +5675,13 @@ AbcdCBefgBhiBqz
|
||||
/[\Q]a\E]+/
|
||||
aa]]
|
||||
|
||||
+'\A(?:[^\"]++|\"(?:[^\"]*+|\"\")*+\")++'
|
||||
+ NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED
|
||||
+
|
||||
+'\A(?:[^\"]++|\"(?:[^\"]++|\"\")*+\")++'
|
||||
+ NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED
|
||||
+
|
||||
+'\A(?:[^\"]++|\"(?:[^\"]++|\"\")++\")++'
|
||||
+ NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED
|
||||
+
|
||||
/-- End of testinput1 --/
|
||||
diff --git a/testdata/testinput8 b/testdata/testinput8
|
||||
index bb2747b..06334cd 100644
|
||||
--- a/testdata/testinput8
|
||||
+++ b/testdata/testinput8
|
||||
@@ -4831,4 +4831,10 @@
|
||||
/[ab]{2,}?/
|
||||
aaaa
|
||||
|
||||
+'\A(?:[^\"]++|\"(?:[^\"]*+|\"\")*+\")++'
|
||||
+ NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED
|
||||
+
|
||||
+'\A(?:[^\"]++|\"(?:[^\"]++|\"\")*+\")++'
|
||||
+ NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED
|
||||
+
|
||||
/-- End of testinput8 --/
|
||||
diff --git a/testdata/testoutput1 b/testdata/testoutput1
|
||||
index 3d9a328..b2ae430 100644
|
||||
--- a/testdata/testoutput1
|
||||
+++ b/testdata/testoutput1
|
||||
@@ -9325,4 +9325,16 @@ No match
|
||||
aa]]
|
||||
0: aa]]
|
||||
|
||||
+'\A(?:[^\"]++|\"(?:[^\"]*+|\"\")*+\")++'
|
||||
+ NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED
|
||||
+ 0: NON QUOTED "QUOT""ED" AFTER
|
||||
+
|
||||
+'\A(?:[^\"]++|\"(?:[^\"]++|\"\")*+\")++'
|
||||
+ NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED
|
||||
+ 0: NON QUOTED "QUOT""ED" AFTER
|
||||
+
|
||||
+'\A(?:[^\"]++|\"(?:[^\"]++|\"\")++\")++'
|
||||
+ NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED
|
||||
+ 0: NON QUOTED "QUOT""ED" AFTER
|
||||
+
|
||||
/-- End of testinput1 --/
|
||||
diff --git a/testdata/testoutput8 b/testdata/testoutput8
|
||||
index 3861ea4..95c4e4d 100644
|
||||
--- a/testdata/testoutput8
|
||||
+++ b/testdata/testoutput8
|
||||
@@ -7777,4 +7777,12 @@ Matched, but offsets vector is too small to show all matches
|
||||
1: aaa
|
||||
2: aa
|
||||
|
||||
+'\A(?:[^\"]++|\"(?:[^\"]*+|\"\")*+\")++'
|
||||
+ NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED
|
||||
+ 0: NON QUOTED "QUOT""ED" AFTER
|
||||
+
|
||||
+'\A(?:[^\"]++|\"(?:[^\"]++|\"\")*+\")++'
|
||||
+ NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED
|
||||
+ 0: NON QUOTED "QUOT""ED" AFTER
|
||||
+
|
||||
/-- End of testinput8 --/
|
||||
--
|
||||
1.9.3
|
||||
|
@ -1,217 +0,0 @@
|
||||
From da9e61642f795d859ef94e1e7a1f2b93489f915a Mon Sep 17 00:00:00 2001
|
||||
From: ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>
|
||||
Date: Wed, 18 Jun 2014 16:48:57 +0000
|
||||
Subject: [PATCH] Fix not including VT in starting characters for \s.
|
||||
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@1486 2f5784b3-3f2a-0410-8824-cb99058d5e15
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
|
||||
Petr Pisar: Ported to 8.35.
|
||||
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
pcre_study.c | 13 +++----------
|
||||
testdata/testinput1 | 3 +++
|
||||
testdata/testoutput1 | 4 ++++
|
||||
testdata/testoutput15 | 20 ++++++++++----------
|
||||
testdata/testoutput18-16 | 30 +++++++++++++++---------------
|
||||
testdata/testoutput18-32 | 30 +++++++++++++++---------------
|
||||
6 files changed, 50 insertions(+), 50 deletions(-)
|
||||
|
||||
diff --git a/pcre_study.c b/pcre_study.c
|
||||
index ab9510e..cb6c424 100644
|
||||
--- a/pcre_study.c
|
||||
+++ b/pcre_study.c
|
||||
@@ -1106,24 +1106,17 @@ do
|
||||
try_next = FALSE;
|
||||
break;
|
||||
|
||||
- /* The cbit_space table has vertical tab as whitespace; we have to
|
||||
- ensure it is set as not whitespace. Luckily, the code value is the same
|
||||
- (0x0b) in ASCII and EBCDIC, so we can just adjust the appropriate bit. */
|
||||
+ /* The cbit_space table has vertical tab as whitespace; we no longer
|
||||
+ have to play fancy tricks because Perl added VT to its whitespace at
|
||||
+ release 5.18. PCRE added it at release 8.34. */
|
||||
|
||||
case OP_NOT_WHITESPACE:
|
||||
set_nottype_bits(start_bits, cbit_space, table_limit, cd);
|
||||
- start_bits[1] |= 0x08;
|
||||
try_next = FALSE;
|
||||
break;
|
||||
|
||||
- /* The cbit_space table has vertical tab as whitespace; we have to not
|
||||
- set it from the table. Luckily, the code value is the same (0x0b) in
|
||||
- ASCII and EBCDIC, so we can just adjust the appropriate bit. */
|
||||
-
|
||||
case OP_WHITESPACE:
|
||||
- c = start_bits[1]; /* Save in case it was already set */
|
||||
set_type_bits(start_bits, cbit_space, table_limit, cd);
|
||||
- start_bits[1] = (start_bits[1] & ~0x08) | c;
|
||||
try_next = FALSE;
|
||||
break;
|
||||
|
||||
diff --git a/testdata/testinput1 b/testdata/testinput1
|
||||
index 7b36360..b68e574 100644
|
||||
--- a/testdata/testinput1
|
||||
+++ b/testdata/testinput1
|
||||
@@ -5666,4 +5666,7 @@ AbcdCBefgBhiBqz
|
||||
/(a\Kb)*/+
|
||||
ababc
|
||||
|
||||
+/\sabc/
|
||||
+ \x{0b}abc
|
||||
+
|
||||
/-- End of testinput1 --/
|
||||
diff --git a/testdata/testoutput1 b/testdata/testoutput1
|
||||
index 4dafc04..e0e5f2c 100644
|
||||
--- a/testdata/testoutput1
|
||||
+++ b/testdata/testoutput1
|
||||
@@ -9313,4 +9313,8 @@ No match
|
||||
0+ c
|
||||
1: ab
|
||||
|
||||
+/\sabc/
|
||||
+ \x{0b}abc
|
||||
+ 0: \x0babc
|
||||
+
|
||||
/-- End of testinput1 --/
|
||||
diff --git a/testdata/testoutput15 b/testdata/testoutput15
|
||||
index 5af369d..bad2807 100644
|
||||
--- a/testdata/testoutput15
|
||||
+++ b/testdata/testoutput15
|
||||
@@ -871,7 +871,7 @@ Options: utf
|
||||
No first char
|
||||
Need char = 'x'
|
||||
Subject length lower bound = 5
|
||||
-Starting chars: \x09 \x0a \x0c \x0d \x20 \xc2
|
||||
+Starting chars: \x09 \x0a \x0b \x0c \x0d \x20 \xc2
|
||||
AB\x{85}xxx\x{a0}XYZ
|
||||
0: \x{85}xxx\x{a0}
|
||||
AB\x{a0}xxx\x{85}XYZ
|
||||
@@ -883,15 +883,15 @@ Options: utf
|
||||
No first char
|
||||
Need char = ' '
|
||||
Subject length lower bound = 3
|
||||
-Starting chars: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x0b \x0e
|
||||
- \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 \x1a \x1b \x1c \x1d
|
||||
- \x1e \x1f ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @
|
||||
- A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e
|
||||
- f g h i j k l m n o p q r s t u v w x y z { | } ~ \x7f \xc0 \xc1 \xc2 \xc3
|
||||
- \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc \xcd \xce \xcf \xd0 \xd1 \xd2
|
||||
- \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb \xdc \xdd \xde \xdf \xe0 \xe1
|
||||
- \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea \xeb \xec \xed \xee \xef \xf0
|
||||
- \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9 \xfa \xfb \xfc \xfd \xfe \xff
|
||||
+Starting chars: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x0e \x0f
|
||||
+ \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 \x1a \x1b \x1c \x1d \x1e
|
||||
+ \x1f ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C
|
||||
+ D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h
|
||||
+ i j k l m n o p q r s t u v w x y z { | } ~ \x7f \xc0 \xc1 \xc2 \xc3 \xc4
|
||||
+ \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc \xcd \xce \xcf \xd0 \xd1 \xd2 \xd3
|
||||
+ \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb \xdc \xdd \xde \xdf \xe0 \xe1 \xe2
|
||||
+ \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea \xeb \xec \xed \xee \xef \xf0 \xf1
|
||||
+ \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9 \xfa \xfb \xfc \xfd \xfe \xff
|
||||
\x{a2} \x{84}
|
||||
0: \x{a2} \x{84}
|
||||
A Z
|
||||
diff --git a/testdata/testoutput18-16 b/testdata/testoutput18-16
|
||||
index a196205..1ef8704 100644
|
||||
--- a/testdata/testoutput18-16
|
||||
+++ b/testdata/testoutput18-16
|
||||
@@ -752,7 +752,7 @@ Options: utf
|
||||
No first char
|
||||
Need char = 'x'
|
||||
Subject length lower bound = 5
|
||||
-Starting chars: \x09 \x0a \x0c \x0d \x20 \x85 \xa0
|
||||
+Starting chars: \x09 \x0a \x0b \x0c \x0d \x20 \x85 \xa0
|
||||
AB\x{85}xxx\x{a0}XYZ
|
||||
0: \x{85}xxx\x{a0}
|
||||
AB\x{a0}xxx\x{85}XYZ
|
||||
@@ -764,20 +764,20 @@ Options: utf
|
||||
No first char
|
||||
Need char = ' '
|
||||
Subject length lower bound = 3
|
||||
-Starting chars: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x0b \x0e
|
||||
- \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 \x1a \x1b \x1c \x1d
|
||||
- \x1e \x1f ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @
|
||||
- A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e
|
||||
- f g h i j k l m n o p q r s t u v w x y z { | } ~ \x7f \x80 \x81 \x82 \x83
|
||||
- \x84 \x86 \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f \x90 \x91 \x92 \x93
|
||||
- \x94 \x95 \x96 \x97 \x98 \x99 \x9a \x9b \x9c \x9d \x9e \x9f \xa1 \xa2 \xa3
|
||||
- \xa4 \xa5 \xa6 \xa7 \xa8 \xa9 \xaa \xab \xac \xad \xae \xaf \xb0 \xb1 \xb2
|
||||
- \xb3 \xb4 \xb5 \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc \xbd \xbe \xbf \xc0 \xc1
|
||||
- \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc \xcd \xce \xcf \xd0
|
||||
- \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb \xdc \xdd \xde \xdf
|
||||
- \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea \xeb \xec \xed \xee
|
||||
- \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9 \xfa \xfb \xfc \xfd
|
||||
- \xfe \xff
|
||||
+Starting chars: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x0e \x0f
|
||||
+ \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 \x1a \x1b \x1c \x1d \x1e
|
||||
+ \x1f ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C
|
||||
+ D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h
|
||||
+ i j k l m n o p q r s t u v w x y z { | } ~ \x7f \x80 \x81 \x82 \x83 \x84
|
||||
+ \x86 \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f \x90 \x91 \x92 \x93 \x94
|
||||
+ \x95 \x96 \x97 \x98 \x99 \x9a \x9b \x9c \x9d \x9e \x9f \xa1 \xa2 \xa3 \xa4
|
||||
+ \xa5 \xa6 \xa7 \xa8 \xa9 \xaa \xab \xac \xad \xae \xaf \xb0 \xb1 \xb2 \xb3
|
||||
+ \xb4 \xb5 \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc \xbd \xbe \xbf \xc0 \xc1 \xc2
|
||||
+ \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc \xcd \xce \xcf \xd0 \xd1
|
||||
+ \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb \xdc \xdd \xde \xdf \xe0
|
||||
+ \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea \xeb \xec \xed \xee \xef
|
||||
+ \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9 \xfa \xfb \xfc \xfd \xfe
|
||||
+ \xff
|
||||
\x{a2} \x{84}
|
||||
0: \x{a2} \x{84}
|
||||
A Z
|
||||
diff --git a/testdata/testoutput18-32 b/testdata/testoutput18-32
|
||||
index 1525994..622ba64 100644
|
||||
--- a/testdata/testoutput18-32
|
||||
+++ b/testdata/testoutput18-32
|
||||
@@ -749,7 +749,7 @@ Options: utf
|
||||
No first char
|
||||
Need char = 'x'
|
||||
Subject length lower bound = 5
|
||||
-Starting chars: \x09 \x0a \x0c \x0d \x20 \x85 \xa0
|
||||
+Starting chars: \x09 \x0a \x0b \x0c \x0d \x20 \x85 \xa0
|
||||
AB\x{85}xxx\x{a0}XYZ
|
||||
0: \x{85}xxx\x{a0}
|
||||
AB\x{a0}xxx\x{85}XYZ
|
||||
@@ -761,20 +761,20 @@ Options: utf
|
||||
No first char
|
||||
Need char = ' '
|
||||
Subject length lower bound = 3
|
||||
-Starting chars: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x0b \x0e
|
||||
- \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 \x1a \x1b \x1c \x1d
|
||||
- \x1e \x1f ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @
|
||||
- A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e
|
||||
- f g h i j k l m n o p q r s t u v w x y z { | } ~ \x7f \x80 \x81 \x82 \x83
|
||||
- \x84 \x86 \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f \x90 \x91 \x92 \x93
|
||||
- \x94 \x95 \x96 \x97 \x98 \x99 \x9a \x9b \x9c \x9d \x9e \x9f \xa1 \xa2 \xa3
|
||||
- \xa4 \xa5 \xa6 \xa7 \xa8 \xa9 \xaa \xab \xac \xad \xae \xaf \xb0 \xb1 \xb2
|
||||
- \xb3 \xb4 \xb5 \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc \xbd \xbe \xbf \xc0 \xc1
|
||||
- \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc \xcd \xce \xcf \xd0
|
||||
- \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb \xdc \xdd \xde \xdf
|
||||
- \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea \xeb \xec \xed \xee
|
||||
- \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9 \xfa \xfb \xfc \xfd
|
||||
- \xfe \xff
|
||||
+Starting chars: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x0e \x0f
|
||||
+ \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 \x1a \x1b \x1c \x1d \x1e
|
||||
+ \x1f ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C
|
||||
+ D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h
|
||||
+ i j k l m n o p q r s t u v w x y z { | } ~ \x7f \x80 \x81 \x82 \x83 \x84
|
||||
+ \x86 \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f \x90 \x91 \x92 \x93 \x94
|
||||
+ \x95 \x96 \x97 \x98 \x99 \x9a \x9b \x9c \x9d \x9e \x9f \xa1 \xa2 \xa3 \xa4
|
||||
+ \xa5 \xa6 \xa7 \xa8 \xa9 \xaa \xab \xac \xad \xae \xaf \xb0 \xb1 \xb2 \xb3
|
||||
+ \xb4 \xb5 \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc \xbd \xbe \xbf \xc0 \xc1 \xc2
|
||||
+ \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc \xcd \xce \xcf \xd0 \xd1
|
||||
+ \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb \xdc \xdd \xde \xdf \xe0
|
||||
+ \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea \xeb \xec \xed \xee \xef
|
||||
+ \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9 \xfa \xfb \xfc \xfd \xfe
|
||||
+ \xff
|
||||
\x{a2} \x{84}
|
||||
0: \x{a2} \x{84}
|
||||
A Z
|
||||
--
|
||||
1.9.3
|
||||
|
@ -1,127 +0,0 @@
|
||||
From bbbc944ef10fe3f383e95b10c13308c0695d0d1a Mon Sep 17 00:00:00 2001
|
||||
From: ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>
|
||||
Date: Tue, 8 Jul 2014 16:16:14 +0000
|
||||
Subject: [PATCH] Fixed several memory leaks in pcregrep.
|
||||
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@1492 2f5784b3-3f2a-0410-8824-cb99058d5e15
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
|
||||
Petr Pisar: Ported to 8.35.
|
||||
|
||||
diff --git a/pcregrep.c b/pcregrep.c
|
||||
index 3e8d05d..fc3f3b2 100644
|
||||
--- a/pcregrep.c
|
||||
+++ b/pcregrep.c
|
||||
@@ -455,7 +455,7 @@ Arguments:
|
||||
s pattern string to add
|
||||
after if not NULL points to item to insert after
|
||||
|
||||
-Returns: new pattern block
|
||||
+Returns: new pattern block or NULL on error
|
||||
*/
|
||||
|
||||
static patstr *
|
||||
@@ -471,6 +471,7 @@ if (strlen(s) > MAXPATLEN)
|
||||
{
|
||||
fprintf(stderr, "pcregrep: pattern is too long (limit is %d bytes)\n",
|
||||
MAXPATLEN);
|
||||
+ free(p);
|
||||
return NULL;
|
||||
}
|
||||
p->next = NULL;
|
||||
@@ -2549,7 +2550,11 @@ while (fgets(buffer, PATBUFSIZE, f) != NULL)
|
||||
afterwards, as a precaution against any later code trying to use it. */
|
||||
|
||||
*patlastptr = add_pattern(buffer, *patlastptr);
|
||||
- if (*patlastptr == NULL) return FALSE;
|
||||
+ if (*patlastptr == NULL)
|
||||
+ {
|
||||
+ if (f != stdin) fclose(f);
|
||||
+ return FALSE;
|
||||
+ }
|
||||
if (*patptr == NULL) *patptr = *patlastptr;
|
||||
|
||||
/* This loop is needed because compiling a "pattern" when -F is set may add
|
||||
@@ -2561,7 +2566,10 @@ while (fgets(buffer, PATBUFSIZE, f) != NULL)
|
||||
{
|
||||
if (!compile_pattern(*patlastptr, pcre_options, popts, TRUE, filename,
|
||||
linenumber))
|
||||
+ {
|
||||
+ if (f != stdin) fclose(f);
|
||||
return FALSE;
|
||||
+ }
|
||||
(*patlastptr)->string = NULL; /* Insurance */
|
||||
if ((*patlastptr)->next == NULL) break;
|
||||
*patlastptr = (*patlastptr)->next;
|
||||
@@ -2962,8 +2970,8 @@ if (locale == NULL)
|
||||
locale_from = "LC_CTYPE";
|
||||
}
|
||||
|
||||
-/* If a locale has been provided, set it, and generate the tables the PCRE
|
||||
-needs. Otherwise, pcretables==NULL, which causes the use of default tables. */
|
||||
+/* If a locale is set, use it to generate the tables the PCRE needs. Otherwise,
|
||||
+pcretables==NULL, which causes the use of default tables. */
|
||||
|
||||
if (locale != NULL)
|
||||
{
|
||||
@@ -2971,7 +2979,7 @@ if (locale != NULL)
|
||||
{
|
||||
fprintf(stderr, "pcregrep: Failed to set locale %s (obtained from %s)\n",
|
||||
locale, locale_from);
|
||||
- return 2;
|
||||
+ goto EXIT2;
|
||||
}
|
||||
pcretables = pcre_maketables();
|
||||
}
|
||||
@@ -2986,7 +2994,7 @@ if (colour_option != NULL && strcmp(colour_option, "never") != 0)
|
||||
{
|
||||
fprintf(stderr, "pcregrep: Unknown colour setting \"%s\"\n",
|
||||
colour_option);
|
||||
- return 2;
|
||||
+ goto EXIT2;
|
||||
}
|
||||
if (do_colour)
|
||||
{
|
||||
@@ -3026,7 +3034,7 @@ else if (strcmp(newline, "anycrlf") == 0 || strcmp(newline, "ANYCRLF") == 0)
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "pcregrep: Invalid newline specifier \"%s\"\n", newline);
|
||||
- return 2;
|
||||
+ goto EXIT2;
|
||||
}
|
||||
|
||||
/* Interpret the text values for -d and -D */
|
||||
@@ -3039,7 +3047,7 @@ if (dee_option != NULL)
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "pcregrep: Invalid value \"%s\" for -d\n", dee_option);
|
||||
- return 2;
|
||||
+ goto EXIT2;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3050,7 +3058,7 @@ if (DEE_option != NULL)
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "pcregrep: Invalid value \"%s\" for -D\n", DEE_option);
|
||||
- return 2;
|
||||
+ goto EXIT2;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3251,7 +3259,8 @@ EXIT:
|
||||
if (jit_stack != NULL) pcre_jit_stack_free(jit_stack);
|
||||
#endif
|
||||
|
||||
-if (main_buffer != NULL) free(main_buffer);
|
||||
+free(main_buffer);
|
||||
+free((void *)pcretables);
|
||||
|
||||
free_pattern_chain(patterns);
|
||||
free_pattern_chain(include_patterns);
|
||||
--
|
||||
1.9.3
|
||||
|
45
pcre.spec
45
pcre.spec
@ -1,8 +1,8 @@
|
||||
# This is stable release:
|
||||
#%%global rcversion RC1
|
||||
%global rcversion RC1
|
||||
Name: pcre
|
||||
Version: 8.35
|
||||
Release: %{?rcversion:0.}6%{?rcversion:.%rcversion}%{?dist}.1
|
||||
Version: 8.36
|
||||
Release: %{?rcversion:0.}1%{?rcversion:.%rcversion}%{?dist}
|
||||
%global myversion %{version}%{?rcversion:-%rcversion}
|
||||
Summary: Perl-compatible regular expression library
|
||||
Group: System Environment/Libraries
|
||||
@ -13,31 +13,6 @@ Source: ftp://ftp.csx.cam.ac.uk/pub/software/programming/%{name}/%{?rcversion:Te
|
||||
Patch0: pcre-8.21-multilib.patch
|
||||
# Refused by upstream, bug #675477
|
||||
Patch1: pcre-8.32-refused_spelling_terminated.patch
|
||||
# Do no rely on wrapping signed integer while parsing {min,max} expression,
|
||||
# bug #1086630, upstream bug #1463
|
||||
Patch2: pcre-8.35-Do-not-rely-on-wrapping-signed-integer-while-parsein.patch
|
||||
# Fix bad starting data when char with more than one other case follows
|
||||
# circumflex in multiline UTF mode, bug #1110620, upstream bug #1492,
|
||||
# in upstream after 8.35
|
||||
Patch3: pcre-8.35-Fix-bad-starting-data-when-char-with-more-than-one-o.patch
|
||||
# Fix not including VT in starting characters for \s if pcre_study() is used,
|
||||
# bug #1111045, upstream bug #1493, in upstream after 8.35
|
||||
Patch4: pcre-8.35-Fix-not-including-VT-in-starting-characters-for-s.patch
|
||||
# Fix character class with a literal quotation, bug #1111054,
|
||||
# upstream bug #1494, in upstream after 8.35
|
||||
Patch5: pcre-8.35-Fix-bad-compile-of-Qx-.-where-x-is-any-character.patch
|
||||
# Fix empty-matching possessive zero-repeat groups in interpreted mode,
|
||||
# bug #1119241, upstream bug #1500, in upstream after 8.35
|
||||
Patch6: pcre-8.35-Fix-empty-matching-possessive-zero-repeat-groups-bug.patch
|
||||
# Fix memory leaks in pcregrep, bug #1119257, upstream bug #1502,
|
||||
# in upstream after 8.35
|
||||
Patch7: pcre-8.35-Fixed-several-memory-leaks-in-pcregrep.patch
|
||||
# Fix compiler crash for zero-repeated groups with a recursive back reference,
|
||||
# bug #1119272, upstream bug #1503, in upstream after 8.35
|
||||
Patch8: pcre-8.35-Fix-compiler-crash-misbehaviour-for-zero-repeated-gr.patch
|
||||
# Fix compile-time loop for recursive reference within a group with an
|
||||
# indefinite repeat, bug #1128577, upstream bug #1515, in upstream after 8.35
|
||||
Patch9: pcre-8.35-Fix-compile-time-loop-for-recursive-reference-within.patch
|
||||
BuildRequires: readline-devel
|
||||
# New libtool to get rid of rpath
|
||||
BuildRequires: autoconf, automake, libtool
|
||||
@ -79,14 +54,6 @@ Utilities demonstrating PCRE capabilities like pcregrep or pcretest.
|
||||
# Get rid of rpath
|
||||
%patch0 -p1 -b .multilib
|
||||
%patch1 -p1 -b .terminated_typos
|
||||
%patch2 -p1 -b .gcc49
|
||||
%patch3 -p1 -b .starting_data
|
||||
%patch4 -p1 -b .studied_vt
|
||||
%patch5 -p1 -b .class_with_literal
|
||||
%patch6 -p1 -b .empty_zero_repeat_group
|
||||
%patch7 -p1 -b .pcregrep_leak
|
||||
%patch8 -p1 -b .compiler_crash_zero_group
|
||||
%patch9 -p1 -b .compiler_loop_recursive_reference
|
||||
# Because of rpath patch
|
||||
libtoolize --copy --force && autoreconf -vif
|
||||
# One contributor's name is non-UTF-8
|
||||
@ -102,7 +69,7 @@ done
|
||||
%global optflags %{optflags} -fno-strict-aliasing
|
||||
%endif
|
||||
%configure \
|
||||
%ifarch aarch64 s390 s390x sparc64 sparcv9
|
||||
%ifarch s390 s390x sparc64 sparcv9
|
||||
--disable-jit \
|
||||
%else
|
||||
--enable-jit \
|
||||
@ -157,6 +124,10 @@ make %{?_smp_mflags} check VERBOSE=yes
|
||||
%{_mandir}/man1/pcretest.*
|
||||
|
||||
%changelog
|
||||
* Tue Sep 16 2014 Petr Pisar <ppisar@redhat.com> - 8.36-0.1.RC1
|
||||
- 8.36 RC1 bump
|
||||
- Enable JIT on aarch64
|
||||
|
||||
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 8.35-6.1
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user