Skip to content

Commit cd9e176

Browse files
author
akuchling
committed
Add nasty test case that overflows the stack with a repeated group
git-svn-id: http://svn.python.org/projects/python/trunk@16592 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent 407fdb2 commit cd9e176

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Lib/test/test_re.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
except:
2929
raise TestFailed, "re.search"
3030

31+
# Try nasty case that overflows the straightforward recursive
32+
# implementation of repeated groups.
33+
assert re.match('(x)*', 50000*'x').span() == (0, 50000)
34+
3135
if verbose:
3236
print 'Running tests on re.sub'
3337

0 commit comments

Comments
 (0)