Fix more undefined-behaviour inducing overflow checks in struct module.

This commit is contained in:
Mark Dickinson 2010-06-11 19:50:30 +00:00
parent 2e5416d0e6
commit b72e6860d8
2 changed files with 25 additions and 19 deletions

View file

@ -510,6 +510,8 @@ class StructTest(unittest.TestCase):
hugecount = '{}b'.format(sys.maxsize+1)
self.assertRaises(struct.error, struct.calcsize, hugecount)
hugecount2 = '{}b{}H'.format(sys.maxsize//2, sys.maxsize//2)
self.assertRaises(struct.error, struct.calcsize, hugecount2)
if IS32BIT:
def test_crasher(self):