summaryrefslogtreecommitdiff
path: root/Lib/test/test_posix.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-01-19 12:41:45 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2013-01-19 12:41:45 +0200
commit9101e23ff6006d9ede7d46e8c9e7d39e23c2a3c3 (patch)
treec61aebdba4dddc8f10c9460ca33b0fa3f2e1495d /Lib/test/test_posix.py
parentbd8f29028eab752e8e5c73703218a701028c1a9a (diff)
parent441d30fac7f4037e4a79e4ada873de3b6f6e5a26 (diff)
downloadcpython-git-9101e23ff6006d9ede7d46e8c9e7d39e23c2a3c3.tar.gz
Issue #15989: Fix several occurrences of integer overflow
when result of PyLong_AsLong() narrowed to int without checks. This is a backport of changesets 13e2e44db99d and 525407d89277.
Diffstat (limited to 'Lib/test/test_posix.py')
-rw-r--r--Lib/test/test_posix.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py
index 5843b03039..7f691d4596 100644
--- a/Lib/test/test_posix.py
+++ b/Lib/test/test_posix.py
@@ -17,6 +17,7 @@ import stat
import tempfile
import unittest
import warnings
+import _testcapi
_DUMMY_SYMLINK = os.path.join(tempfile.gettempdir(),
support.TESTFN + '-dummy-symlink')
@@ -537,6 +538,10 @@ class PosixTester(unittest.TestCase):
except OSError:
pass
+ # Issue 15989
+ self.assertRaises(OverflowError, os.pipe2, _testcapi.INT_MAX + 1)
+ self.assertRaises(OverflowError, os.pipe2, _testcapi.UINT_MAX + 1)
+
def test_utime(self):
if hasattr(posix, 'utime'):
now = time.time()