summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_devpoll.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-12-14 17:18:39 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-12-14 17:18:39 (GMT)
commit03241e801780edd967923d1cce00c2d07b208e58 (patch)
tree4b989c68d63e46df115ba53a2ed9a0b0c6314c85 /Lib/test/test_devpoll.py
parent530a69fafce36317f1c83fe4998831f2d4284f3a (diff)
parent5da107ac7261d8359cd6e1a9a8e57f85176d1180 (diff)
downloadcpython-03241e801780edd967923d1cce00c2d07b208e58.zip
cpython-03241e801780edd967923d1cce00c2d07b208e58.tar.gz
cpython-03241e801780edd967923d1cce00c2d07b208e58.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.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_devpoll.py b/Lib/test/test_devpoll.py
index 40ebeee..bd0db61 100644
--- a/Lib/test/test_devpoll.py
+++ b/Lib/test/test_devpoll.py
@@ -121,6 +121,17 @@ class DevPollTests(unittest.TestCase):
self.assertEqual(os.get_inheritable(devpoll.fileno()), False)
+ 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)