Add checks to the endpoint and pipe configure functions and fail if the requested...
[pub/USBasp.git] / LUFA / Drivers / USB / Core / UC3 / Pipe_UC3.c
index 196eb07..23c004d 100644 (file)
@@ -69,6 +69,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;