summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2009-09-29 19:21:35 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2009-09-29 19:21:35 (GMT)
commit2683ab04a6859681149d6c0851ece719fdc8237c (patch)
tree69b53685dcc216f3b68a2e60b592d7c0a063f363 /Lib
parentead1d62d3239109656d4b3fd2f99461dddb2fae1 (diff)
downloadcpython-2683ab04a6859681149d6c0851ece719fdc8237c.zip
cpython-2683ab04a6859681149d6c0851ece719fdc8237c.tar.gz
cpython-2683ab04a6859681149d6c0851ece719fdc8237c.tar.bz2
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')
-rw-r--r--Lib/test/test_marshal.py5
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,