mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
bpo-40263: Fixes an off-by-one error in _winapi_WaitForMultipleObjects_impl (GH-19501)
This commit is contained in:
parent
31bec6f1b1
commit
92b5dc780d
2 changed files with 4 additions and 1 deletions
|
|
@ -0,0 +1,3 @@
|
|||
This is a follow-on bug from https://bugs.python.org/issue26903. Once that
|
||||
is applied we run into an off-by-one assertion problem. The assert was not
|
||||
correct.
|
||||
|
|
@ -1722,7 +1722,7 @@ _winapi_WaitForMultipleObjects_impl(PyObject *module, PyObject *handle_seq,
|
|||
nhandles = PySequence_Length(handle_seq);
|
||||
if (nhandles == -1)
|
||||
return NULL;
|
||||
if (nhandles < 0 || nhandles >= MAXIMUM_WAIT_OBJECTS - 1) {
|
||||
if (nhandles < 0 || nhandles > MAXIMUM_WAIT_OBJECTS - 1) {
|
||||
PyErr_Format(PyExc_ValueError,
|
||||
"need at most %zd handles, got a sequence of length %zd",
|
||||
MAXIMUM_WAIT_OBJECTS - 1, nhandles);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue