diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-01-14 17:34:48 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-01-14 17:34:48 (GMT) |
commit | 82feb1f360c26c78f0c5159609f3f697008a9238 (patch) | |
tree | c078d382cc4a24d14bae03aea9e7db1e704012fd /Lib/test/test_re.py | |
parent | 6d4b00ccc15f46702e1ab9242f16f4a80003f95a (diff) | |
download | cpython-82feb1f360c26c78f0c5159609f3f697008a9238.zip cpython-82feb1f360c26c78f0c5159609f3f697008a9238.tar.gz cpython-82feb1f360c26c78f0c5159609f3f697008a9238.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/test/test_re.py')
-rw-r--r-- | Lib/test/test_re.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py index 8b4d268..c41722c 100644 --- a/Lib/test/test_re.py +++ b/Lib/test/test_re.py @@ -717,6 +717,12 @@ class ReTests(unittest.TestCase): self.assertRaises(ValueError, re.compile, '(?a)\w', re.UNICODE) self.assertRaises(ValueError, re.compile, '(?au)\w') + 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 |