]> granicus.if.org Git - python/commitdiff
A bug in PCRE could cause core dumps in patterns such as
authorGuido van Rossum <guido@python.org>
Fri, 20 Feb 1998 21:45:14 +0000 (21:45 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 20 Feb 1998 21:45:14 +0000 (21:45 +0000)
'((a)*)*'. Andrew Kuchling posted a fix to the string-sig.

Modules/pypcre.c

index 1d2a9cade7a5e4db305bd3fa2e9cdd1faeb7d9f6..69d6c221b1d68f55384cfdbac370eb4b3f643ff7 100644 (file)
@@ -809,6 +809,13 @@ do {
       case OP_KETRMIN:
       return TRUE;
 
+      /* Skip over entire bracket groups with zero lower bound */
+
+      case OP_BRAZERO:
+      case OP_BRAMINZERO:
+      cc++;
+      /* Fall through */
+
       /* Skip over assertive subpatterns */
 
       case OP_ASSERT:
@@ -823,8 +830,6 @@ do {
       case OP_EOD:
       case OP_CIRC:
       case OP_DOLL:
-      case OP_BRAZERO:
-      case OP_BRAMINZERO:
       case OP_NOT_WORD_BOUNDARY:
       case OP_WORD_BOUNDARY:
       case OP_NOT_WORD_BOUNDARY_L: