projects
/
pub
/
USBasp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Add checks to the endpoint and pipe configure functions and fail if the requested...
[pub/USBasp.git]
/
LUFA
/
Drivers
/
USB
/
Core
/
AVR8
/
Pipe_AVR8.c
diff --git
a/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.c
b/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.c
index
1ddffb5
..
b643708
100644
(file)
--- a/
LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.c
+++ b/
LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.c
@@
-66,6
+66,9
@@
bool Pipe_ConfigurePipe(const uint8_t Address,
uint8_t Number = (Address & PIPE_EPNUM_MASK);
uint8_t Token = (Address & PIPE_DIR_IN) ? PIPE_TOKEN_IN : PIPE_TOKEN_OUT;
+ if (Number >= PIPE_TOTAL_PIPES)
+ return false;
+
if (Type == EP_TYPE_CONTROL)
Token = PIPE_TOKEN_SETUP;