Revision: 353
http://vcs.pcre.org/viewvc?view=rev&revision=353
Author: ph10
Date: 2008-07-07 16:44:24 +0100 (Mon, 07 Jul 2008)
Log Message:
-----------
Fix SKIPZERO bug in pcre_study().
Modified Paths:
--------------
code/trunk/ChangeLog
code/trunk/pcre_study.c
code/trunk/testdata/testinput2
code/trunk/testdata/testoutput2
Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog 2008-07-07 15:12:56 UTC (rev 352)
+++ code/trunk/ChangeLog 2008-07-07 15:44:24 UTC (rev 353)
@@ -13,6 +13,10 @@
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
Modified: code/trunk/pcre_study.c
===================================================================
--- code/trunk/pcre_study.c 2008-07-07 15:12:56 UTC (rev 352)
+++ code/trunk/pcre_study.c 2008-07-07 15:44:24 UTC (rev 353)
@@ -220,6 +220,7 @@
/* SKIPZERO skips the bracket. */
case OP_SKIPZERO:
+ tcode++;
do tcode += GET(tcode,1); while (*tcode == OP_ALT);
tcode += 1 + LINK_SIZE;
break;
Modified: code/trunk/testdata/testinput2
===================================================================
--- code/trunk/testdata/testinput2 2008-07-07 15:12:56 UTC (rev 352)
+++ code/trunk/testdata/testinput2 2008-07-07 15:44:24 UTC (rev 353)
@@ -2724,4 +2724,6 @@
/a(*FAIL)+b/
+/(abc|pqr|123){0}[xyz]/SI
+
/ End of testinput2 /
Modified: code/trunk/testdata/testoutput2
===================================================================
--- code/trunk/testdata/testoutput2 2008-07-07 15:12:56 UTC (rev 352)
+++ code/trunk/testdata/testoutput2 2008-07-07 15:44:24 UTC (rev 353)
@@ -9631,4 +9631,11 @@
/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 /