mirror of
https://github.com/AdaCore/cpython.git
synced 2026-02-12 12:57:15 -08:00
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 d52a83a3d4)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
This commit is contained in:
committed by
GitHub
parent
5c4ce3e2fa
commit
04d4692579
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user