From: Guido van Rossum Date: Fri, 20 Feb 1998 21:45:14 +0000 (+0000) Subject: A bug in PCRE could cause core dumps in patterns such as X-Git-Tag: v1.5.1~610 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d0f432b8407d4637a9b9044046f7a186ed7dff64;p=python A bug in PCRE could cause core dumps in patterns such as '((a)*)*'. Andrew Kuchling posted a fix to the string-sig. --- diff --git a/Modules/pypcre.c b/Modules/pypcre.c index 1d2a9cade7..69d6c221b1 100644 --- a/Modules/pypcre.c +++ b/Modules/pypcre.c @@ -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: