From: Ezio Melotti Date: Sat, 7 May 2011 15:29:14 +0000 (+0300) Subject: #12017: merge with 3.2. X-Git-Tag: v3.3.0a1~2369 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9c18778695ab002789849e385eeb9d270633a5c6;p=thirdparty%2FPython%2Fcpython.git #12017: merge with 3.2. --- 9c18778695ab002789849e385eeb9d270633a5c6 diff --cc Lib/test/json_tests/test_recursion.py index 1e9b8ab757f3,6d5db5050eeb..3b29b4256fb5 --- a/Lib/test/json_tests/test_recursion.py +++ b/Lib/test/json_tests/test_recursion.py @@@ -65,3 -65,15 +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) -