summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_marshal.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_marshal.py')
-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,