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
index 1ddffb5..b643708 100644 (file)
@@ -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;