summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2008-07-07 15:44:24 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2008-07-07 15:44:24 +0000
commitb17a62a5663fbb1eda289040153ed59188551e15 (patch)
treecca6f6f1bd0c5577326dc4da4f8f03246f963266
parent8c6a807f167a80cc7682a2acbf104a66fcdc57eb (diff)
downloadpcre-b17a62a5663fbb1eda289040153ed59188551e15.tar.gz
Fix SKIPZERO bug in pcre_study().
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@353 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r--ChangeLog4
-rw-r--r--pcre_study.c1
-rw-r--r--testdata/testinput22
-rw-r--r--testdata/testoutput27
4 files changed, 14 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 44c1687..4c97765 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -13,6 +13,10 @@ Version 8.0 02 Jul-08
2. Updated the Unicode datatables to Unicode 5.1.0. This adds yet more
scripts.
+
+3. Change 12 for 7.7 introduced a bug in pcre_study() when a pattern contained
+ a group with a zero qualifier. The result of the study could be incorrect,
+ or the function might crash, depending on the pattern.
Version 7.7 07-May-08
diff --git a/pcre_study.c b/pcre_study.c
index e4e24b6..0136e1e 100644
--- a/pcre_study.c
+++ b/pcre_study.c
@@ -220,6 +220,7 @@ do
/* SKIPZERO skips the bracket. */
case OP_SKIPZERO:
+ tcode++;
do tcode += GET(tcode,1); while (*tcode == OP_ALT);
tcode += 1 + LINK_SIZE;
break;
diff --git a/testdata/testinput2 b/testdata/testinput2
index 93b0f09..8536d66 100644
--- a/testdata/testinput2
+++ b/testdata/testinput2
@@ -2724,4 +2724,6 @@ a random value. /Ix
/a(*FAIL)+b/
+/(abc|pqr|123){0}[xyz]/SI
+
/ End of testinput2 /
diff --git a/testdata/testoutput2 b/testdata/testoutput2
index 4d6d688..5dd2b4c 100644
--- a/testdata/testoutput2
+++ b/testdata/testoutput2
@@ -9631,4 +9631,11 @@ Failed: nothing to repeat at offset 5
/a(*FAIL)+b/
Failed: nothing to repeat at offset 8
+/(abc|pqr|123){0}[xyz]/SI
+Capturing subpattern count = 1
+No options
+No first char
+No need char
+Starting byte set: x y z
+
/ End of testinput2 /