Fix bug in marshal where bad data would cause a segfault due to

lack of an infinite recursion check.

Contributed by Damien Miller at Google.
This commit is contained in:
Neal Norwitz 2007-05-16 20:05:11 +00:00
parent f1135f30f8
commit b1a9b37aa8
4 changed files with 164 additions and 69 deletions

View file

@ -220,6 +220,10 @@ class BugsTestCase(unittest.TestCase):
except Exception:
pass
def test_recursion(self):
s = 'c' + ('X' * 4*4) + '{' * 2**20
self.assertRaises(ValueError, marshal.loads, s)
def test_main():
test_support.run_unittest(IntTestCase,
FloatTestCase,