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.
diff --git a/Lib/test/test_marshal.py b/Lib/test/test_marshal.py
index f87495b..bfdd274 100644
--- a/Lib/test/test_marshal.py
+++ b/Lib/test/test_marshal.py
@@ -220,6 +220,10 @@
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,