diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2011-05-07 15:29:14 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2011-05-07 15:29:14 (GMT) |
commit | 9c18778695ab002789849e385eeb9d270633a5c6 (patch) | |
tree | 9fc84b56a53f9814f9907d01eba281dbccd03e8e /Lib/test | |
parent | dbf04540827ea64859f718b45fc06176a13f9134 (diff) | |
parent | 06383ee090e3c66130db9dc0b562fba3cb749be1 (diff) | |
download | cpython-9c18778695ab002789849e385eeb9d270633a5c6.zip cpython-9c18778695ab002789849e385eeb9d270633a5c6.tar.gz cpython-9c18778695ab002789849e385eeb9d270633a5c6.tar.bz2 |
#12017: merge with 3.2.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/json_tests/test_recursion.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/json_tests/test_recursion.py b/Lib/test/json_tests/test_recursion.py index 1e9b8ab..3b29b42 100644 --- a/Lib/test/json_tests/test_recursion.py +++ b/Lib/test/json_tests/test_recursion.py @@ -65,3 +65,14 @@ class TestRecursion(TestCase): pass else: self.fail("didn't raise ValueError on default recursion") + + + def test_highly_nested_objects(self): + # test that loading highly-nested objects doesn't segfault when C + # accelerations are used. See #12017 + with self.assertRaises(RuntimeError): + json.loads('{"a":' * 100000 + '1' + '}' * 100000) + with self.assertRaises(RuntimeError): + json.loads('{"a":' * 100000 + '[1]' + '}' * 100000) + with self.assertRaises(RuntimeError): + json.loads('[' * 100000 + '1' + ']' * 100000) |