summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2009-09-29 19:01:06 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2009-09-29 19:01:06 (GMT)
commit7e7a3ec901be55c868c800d541b5a1622e0ec7fb (patch)
tree0d99456b092c46913a9358c743ed3270f0d34c25 /Lib/test
parent13305f681ba7ef1bb23c82fee674ec47d822bbbc (diff)
downloadcpython-7e7a3ec901be55c868c800d541b5a1622e0ec7fb.zip
cpython-7e7a3ec901be55c868c800d541b5a1622e0ec7fb.tar.gz
cpython-7e7a3ec901be55c868c800d541b5a1622e0ec7fb.tar.bz2
Issue #7019: Unmarshalling of bad long data could produce unnormalized
PyLongs. Raise ValueError instead.
Diffstat (limited to 'Lib/test')
-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 0cd46a2..7669182 100644
--- a/Lib/test/test_marshal.py
+++ b/Lib/test/test_marshal.py
@@ -262,6 +262,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 = 'l\x02\x00\x00\x00\x00\x00\x00\x00'
+ self.assertRaises(ValueError, marshal.loads, invalid_string)
+
def test_main():
test_support.run_unittest(IntTestCase,