diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2019-06-26 21:20:09 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-26 21:20:09 (GMT) |
commit | 04d4692579cc4e0204c7fbced3692f8aa4bbb857 (patch) | |
tree | 641e0af4cab05291936f074e20927998d0149622 /Modules/posixmodule.c | |
parent | 5c4ce3e2fa73125fb6f9c501e6c4c8512216b7e1 (diff) | |
download | cpython-04d4692579cc4e0204c7fbced3692f8aa4bbb857.zip cpython-04d4692579cc4e0204c7fbced3692f8aa4bbb857.tar.gz cpython-04d4692579cc4e0204c7fbced3692f8aa4bbb857.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.
(cherry picked from commit d52a83a3d471ff3c7e9ebfa1731765e5334f7c24)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Diffstat (limited to 'Modules/posixmodule.c')
-rw-r--r-- | Modules/posixmodule.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 2d68c9d..70b1536 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -5380,7 +5380,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)) { |