summaryrefslogtreecommitdiff
path: root/Modules/_io/fileio.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-01-19 12:26:26 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2013-01-19 12:26:26 +0200
commit441d30fac7f4037e4a79e4ada873de3b6f6e5a26 (patch)
treea406cb41f1b78476445786f408b95b1cd0bdb7a6 /Modules/_io/fileio.c
parentff12fae80e15ad29ae2557d23e70f6ff9365b31f (diff)
downloadcpython-git-441d30fac7f4037e4a79e4ada873de3b6f6e5a26.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 'Modules/_io/fileio.c')
-rw-r--r--Modules/_io/fileio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c
index 8ea7c58aa8..ad4a7e6bcd 100644
--- a/Modules/_io/fileio.c
+++ b/Modules/_io/fileio.c
@@ -240,7 +240,7 @@ fileio_init(PyObject *oself, PyObject *args, PyObject *kwds)
return -1;
}
- fd = PyLong_AsLong(nameobj);
+ fd = _PyLong_AsInt(nameobj);
if (fd < 0) {
if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_ValueError,