From 2bbeb0eacde9a770a9cd9c9e94aae4b48835738f Mon Sep 17 00:00:00 2001 From: Mark Dickinson Date: Tue, 29 Sep 2009 19:24:38 +0000 Subject: Merged revisions 75145 via svnmerge from svn+ssh://pythondev@www.python.org/python/branches/py3k ................ r75145 | mark.dickinson | 2009-09-29 20:21:35 +0100 (Tue, 29 Sep 2009) | 10 lines Merged revisions 75141 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r75141 | mark.dickinson | 2009-09-29 20:01:06 +0100 (Tue, 29 Sep 2009) | 3 lines Issue #7019: Unmarshalling of bad long data could produce unnormalized PyLongs. Raise ValueError instead. ........ ................ --- Lib/test/test_marshal.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Lib/test/test_marshal.py') diff --git a/Lib/test/test_marshal.py b/Lib/test/test_marshal.py index 6e3efe4a31..66887859cd 100644 --- a/Lib/test/test_marshal.py +++ b/Lib/test/test_marshal.py @@ -212,6 +212,11 @@ class BugsTestCase(unittest.TestCase): testString = 'abc' * size marshal.dumps(testString) + def test_invalid_longs(self): + # Issue #7019: marshal.loads shouldn't produce unnormalized PyLongs + invalid_string = b'l\x02\x00\x00\x00\x00\x00\x00\x00' + self.assertRaises(ValueError, marshal.loads, invalid_string) + def test_main(): support.run_unittest(IntTestCase, -- cgit v1.2.1