Skip to content

Commit 04d4692

Browse files
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 d52a83a) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
1 parent 5c4ce3e commit 04d4692

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎Modules/posixmodule.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5380,7 +5380,7 @@ parse_file_actions(PyObject *file_actions,
53805380
return -1;
53815381
}
53825382

5383-
for (int i = 0; i < PySequence_Fast_GET_SIZE(seq); ++i) {
5383+
for (Py_ssize_t i = 0; i < PySequence_Fast_GET_SIZE(seq); ++i) {
53845384
file_action = PySequence_Fast_GET_ITEM(seq, i);
53855385
Py_INCREF(file_action);
53865386
if (!PyTuple_Check(file_action) || !PyTuple_GET_SIZE(file_action)) {

0 commit comments

Comments
 (0)