summaryrefslogtreecommitdiff
path: root/Lib/test/test_marshal.py
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2007-05-16 20:05:11 +0000
committerNeal Norwitz <nnorwitz@gmail.com>2007-05-16 20:05:11 +0000
commitb1a9b37aa836f1c0f827b16cebdd23dfe19fcf4c (patch)
treef69f0ae562a44947f5734763f19f6101df6477b6 /Lib/test/test_marshal.py
parentf1135f30f8c2b6d1d6a875135de37d04c030e071 (diff)
downloadcpython-git-b1a9b37aa836f1c0f827b16cebdd23dfe19fcf4c.tar.gz
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.
Diffstat (limited to 'Lib/test/test_marshal.py')
-rw-r--r--Lib/test/test_marshal.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_marshal.py b/Lib/test/test_marshal.py
index f87495bae2..bfdd2747ef 100644
--- a/Lib/test/test_marshal.py
+++ b/Lib/test/test_marshal.py
@@ -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,