Skip to content

Commit d52a83a

Browse files
ZackerySpytzpablogsal
authored andcommitted
bpo-37419: Fix possible segfaults when passing large sequences to os.posix_spawn() (GH-14409)
Use Py_ssize_t instead of int for i.
1 parent 7213df7 commit d52a83a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Modules/posixmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5377,7 +5377,7 @@ parse_file_actions(PyObject *file_actions,
53775377
return -1;
53785378
}
53795379

5380-
for (int i = 0; i < PySequence_Fast_GET_SIZE(seq); ++i) {
5380+
for (Py_ssize_t i = 0; i < PySequence_Fast_GET_SIZE(seq); ++i) {
53815381
file_action = PySequence_Fast_GET_ITEM(seq, i);
53825382
Py_INCREF(file_action);
53835383
if (!PyTuple_Check(file_action) || !PyTuple_GET_SIZE(file_action)) {

0 commit comments

Comments
 (0)