summaryrefslogtreecommitdiffstats
path: root/Modules/pypcre.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-02-20 21:45:14 (GMT)
committerGuido van Rossum <guido@python.org>1998-02-20 21:45:14 (GMT)
commitd0f432b8407d4637a9b9044046f7a186ed7dff64 (patch)
treea4bebe82a1973222da9054bd0a46420915600531 /Modules/pypcre.c
parentff170fbbb5cb17aba7d2aa0523a389599a2341d7 (diff)
downloadcpython-d0f432b8407d4637a9b9044046f7a186ed7dff64.zip
cpython-d0f432b8407d4637a9b9044046f7a186ed7dff64.tar.gz
cpython-d0f432b8407d4637a9b9044046f7a186ed7dff64.tar.bz2
A bug in PCRE could cause core dumps in patterns such as
'((a)*)*'. Andrew Kuchling posted a fix to the string-sig.
Diffstat (limited to 'Modules/pypcre.c')
-rw-r--r--Modules/pypcre.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/Modules/pypcre.c b/Modules/pypcre.c
index 1d2a9ca..69d6c22 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: