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.
........
This commit is contained in:
Mark Dickinson 2009-09-29 19:21:35 +00:00
parent ead1d62d32
commit 2683ab04a6
3 changed files with 21 additions and 3 deletions

View file

@ -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,