diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2013-12-14 17:12:02 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-12-14 17:12:02 (GMT) |
commit | 5da107ac7261d8359cd6e1a9a8e57f85176d1180 (patch) | |
tree | 171b488800f196c9016ba829cf13abda5f6ee234 /Lib/test/test_devpoll.py | |
parent | 01e5f800b40992f2f61f4fd6ac4eca4ae1847cc0 (diff) | |
download | cpython-5da107ac7261d8359cd6e1a9a8e57f85176d1180.zip cpython-5da107ac7261d8359cd6e1a9a8e57f85176d1180.tar.gz cpython-5da107ac7261d8359cd6e1a9a8e57f85176d1180.tar.bz2 |
Issue #17919: Fixed integer overflow in the eventmask parameter.
Diffstat (limited to 'Lib/test/test_devpoll.py')
-rw-r--r-- | Lib/test/test_devpoll.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_devpoll.py b/Lib/test/test_devpoll.py index bef4e18..c7bacf8 100644 --- a/Lib/test/test_devpoll.py +++ b/Lib/test/test_devpoll.py @@ -87,6 +87,17 @@ class DevPollTests(unittest.TestCase): self.assertRaises(OverflowError, pollster.poll, 1 << 63) self.assertRaises(OverflowError, pollster.poll, 1 << 64) + def test_events_mask_overflow(self): + pollster = select.devpoll() + w, r = os.pipe() + pollster.register(w) + # Issue #17919 + self.assertRaises(OverflowError, pollster.register, 0, -1) + self.assertRaises(OverflowError, pollster.register, 0, USHRT_MAX + 1) + self.assertRaises(OverflowError, pollster.modify, 1, -1) + self.assertRaises(OverflowError, pollster.modify, 1, USHRT_MAX + 1) + + def test_main(): run_unittest(DevPollTests) |