diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2009-09-29 19:24:38 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2009-09-29 19:24:38 (GMT) |
commit | 2bbeb0eacde9a770a9cd9c9e94aae4b48835738f (patch) | |
tree | dc8306659eff5f3e5d0557375c544e3023679d25 /Lib/test/test_marshal.py | |
parent | 595ad32f59820c67c68d1732530338a79b45b810 (diff) | |
download | cpython-2bbeb0eacde9a770a9cd9c9e94aae4b48835738f.zip cpython-2bbeb0eacde9a770a9cd9c9e94aae4b48835738f.tar.gz cpython-2bbeb0eacde9a770a9cd9c9e94aae4b48835738f.tar.bz2 |
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.
........
................
Diffstat (limited to 'Lib/test/test_marshal.py')
-rw-r--r-- | Lib/test/test_marshal.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_marshal.py b/Lib/test/test_marshal.py index 6e3efe4..6688785 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, |