summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-01-14 17:34:09 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-01-14 17:34:09 (GMT)
commit47c8ede0b809980830818caa1e4957743eb25b3f (patch)
tree3229a872d85c3896d245faa558742a81c9c5ce07 /Lib
parent959f318af38040656139aeee71b68cadf4cd70c2 (diff)
downloadcpython-47c8ede0b809980830818caa1e4957743eb25b3f.zip
cpython-47c8ede0b809980830818caa1e4957743eb25b3f.tar.gz
cpython-47c8ede0b809980830818caa1e4957743eb25b3f.tar.bz2
Merged revisions 77499 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r77499 | antoine.pitrou | 2010-01-14 18:25:24 +0100 (jeu., 14 janv. 2010) | 4 lines Issue #3299: Fix possible crash in the _sre module when given bad argument values in debug mode. Patch by Victor Stinner. ........
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_re.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py
index feb7160..c04b626 100644
--- a/Lib/test/test_re.py
+++ b/Lib/test/test_re.py
@@ -685,6 +685,12 @@ class ReTests(unittest.TestCase):
self.assertEqual(pattern.sub('#', 'a\nb\nc'), 'a#\nb#\nc#')
self.assertEqual(pattern.sub('#', '\n'), '#\n#')
+ def test_dealloc(self):
+ # issue 3299: check for segfault in debug build
+ import _sre
+ long_overflow = sys.maxsize + 2
+ self.assertRaises(TypeError, re.finditer, "a", {})
+ self.assertRaises(OverflowError, _sre.compile, "abc", 0, [long_overflow])
def run_re_tests():
from test.re_tests import benchmarks, tests, SUCCEED, FAIL, SYNTAX_ERROR