mirror of
https://github.com/python/cpython
synced 2026-09-28 09:08:16 +03:00
Fixes #23564: Fix a partially broken sanity check in the _posixsubprocess
internals regarding how fds_to_pass were passed to the child. The bug had no actual impact as subprocess.py already avoided it.
This commit is contained in:
parent
2cd1b3b089
commit
d0a5b1c343
3 changed files with 34 additions and 3 deletions
|
|
@ -109,10 +109,11 @@ _sanity_check_python_fd_sequence(PyObject *fd_sequence)
|
|||
for (seq_idx = 0; seq_idx < seq_len; ++seq_idx) {
|
||||
PyObject* py_fd = PySequence_Fast_GET_ITEM(fd_sequence, seq_idx);
|
||||
long iter_fd = PyLong_AsLong(py_fd);
|
||||
if (iter_fd < 0 || iter_fd < prev_fd || iter_fd > INT_MAX) {
|
||||
if (iter_fd < 0 || iter_fd <= prev_fd || iter_fd > INT_MAX) {
|
||||
/* Negative, overflow, not a Long, unsorted, too big for a fd. */
|
||||
return 1;
|
||||
}
|
||||
prev_fd = iter_fd;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue