summaryrefslogtreecommitdiffstats
path: root/Modules/_winapi.c
diff options
context:
space:
mode:
authorRay Donnelly <mingw.android@gmail.com>2021-07-28 19:58:05 (GMT)
committerGitHub <noreply@github.com>2021-07-28 19:58:05 (GMT)
commit92b5dc780db968f6277f42cb06926dddb7475dc6 (patch)
tree35c53b0590afb58d366aad27ba4da38a4e85bd63 /Modules/_winapi.c
parent31bec6f1b178dadec3cb43353274b4e958a8f015 (diff)
downloadcpython-92b5dc780db968f6277f42cb06926dddb7475dc6.zip
cpython-92b5dc780db968f6277f42cb06926dddb7475dc6.tar.gz
cpython-92b5dc780db968f6277f42cb06926dddb7475dc6.tar.bz2
bpo-40263: Fixes an off-by-one error in _winapi_WaitForMultipleObjects_impl (GH-19501)
Diffstat (limited to 'Modules/_winapi.c')
-rw-r--r--Modules/_winapi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_winapi.c b/Modules/_winapi.c
index f341493..bf2498a 100644
--- a/Modules/_winapi.c
+++ b/Modules/_winapi.c
@@ -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);