aboutsummaryrefslogtreecommitdiffstats
path: root/executor
diff options
context:
space:
mode:
authorAndrey Konovalov <andreyknvl@google.com>2023-07-17 21:19:32 +0200
committerAleksandr Nogikh <nogikh@google.com>2023-07-18 12:16:58 +0000
commit022df2bb9a105c303cf24c910b8e787cf642a3f3 (patch)
treee6c1b7defcf16ccc6e1023002cc433bcb44bc1c7 /executor
parent13995e7680faf1839c6fd5be4a84a45a7c0805a4 (diff)
executor: fix loop condition in lookup_endpoint
The loop in lookup_endpoint incorrectly iterates over endpoints. Fixes #4038. Reported-by: @cyruscyliu Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Diffstat (limited to 'executor')
-rw-r--r--executor/common_usb_linux.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/executor/common_usb_linux.h b/executor/common_usb_linux.h
index ed45426a1..b706663f8 100644
--- a/executor/common_usb_linux.h
+++ b/executor/common_usb_linux.h
@@ -187,7 +187,7 @@ static int lookup_endpoint(int fd, uint8 bEndpointAddress)
if (index->iface_cur < 0)
return -1;
- for (int ep = 0; index->ifaces[index->iface_cur].eps_num; ep++)
+ for (int ep = 0; ep < index->ifaces[index->iface_cur].eps_num; ep++)
if (index->ifaces[index->iface_cur].eps[ep].desc.bEndpointAddress == bEndpointAddress)
return index->ifaces[index->iface_cur].eps[ep].handle;
return -1;