summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorZackery Spytz <zspytz@gmail.com>2019-06-26 20:54:20 (GMT)
committerPablo Galindo <Pablogsal@gmail.com>2019-06-26 20:54:19 (GMT)
commitd52a83a3d471ff3c7e9ebfa1731765e5334f7c24 (patch)
tree0d5021501766a6a3e33b02c3dc2e832e3c49f461 /Modules
parent7213df7bbfd85378c6e42e1ac63144d5974bdcf6 (diff)
downloadcpython-d52a83a3d471ff3c7e9ebfa1731765e5334f7c24.zip
cpython-d52a83a3d471ff3c7e9ebfa1731765e5334f7c24.tar.gz
cpython-d52a83a3d471ff3c7e9ebfa1731765e5334f7c24.tar.bz2
bpo-37419: Fix possible segfaults when passing large sequences to os.posix_spawn() (GH-14409)
Use Py_ssize_t instead of int for i.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/posixmodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 5134ed7..5f17fce 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -5377,7 +5377,7 @@ parse_file_actions(PyObject *file_actions,
return -1;
}
- for (int i = 0; i < PySequence_Fast_GET_SIZE(seq); ++i) {
+ for (Py_ssize_t i = 0; i < PySequence_Fast_GET_SIZE(seq); ++i) {
file_action = PySequence_Fast_GET_ITEM(seq, i);
Py_INCREF(file_action);
if (!PyTuple_Check(file_action) || !PyTuple_GET_SIZE(file_action)) {