summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorGregory P. Smith <greg@krypto.org>2015-11-16 05:15:26 (GMT)
committerGregory P. Smith <greg@krypto.org>2015-11-16 05:15:26 (GMT)
commitd0a5b1c3432574c248dfd86e583b5cd09503a374 (patch)
treec48f6cc1e71665862045e08a5e61830426ff44d6 /Modules
parent2cd1b3b08912133ff3d33755a9949c2aa0155b95 (diff)
downloadcpython-d0a5b1c3432574c248dfd86e583b5cd09503a374.zip
cpython-d0a5b1c3432574c248dfd86e583b5cd09503a374.tar.gz
cpython-d0a5b1c3432574c248dfd86e583b5cd09503a374.tar.bz2
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.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_posixsubprocess.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/_posixsubprocess.c b/Modules/_posixsubprocess.c
index 800b301..2cdc381 100644
--- a/Modules/_posixsubprocess.c
+++ b/Modules/_posixsubprocess.c
@@ -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;
}