limit length of wLength
This commit is contained in:
parent
df2f950e69
commit
303c42901a
@ -342,6 +342,7 @@ static uint8_t USBD_HID_Setup (USBD_HandleTypeDef *pdev,
|
|||||||
uint8_t *pbuf = NULL;
|
uint8_t *pbuf = NULL;
|
||||||
uint16_t status_info = 0U;
|
uint16_t status_info = 0U;
|
||||||
USBD_StatusTypeDef ret = USBD_OK;
|
USBD_StatusTypeDef ret = USBD_OK;
|
||||||
|
req->wLength = req->wLength & 0x7f;
|
||||||
|
|
||||||
switch (req->bmRequest & USB_REQ_TYPE_MASK)
|
switch (req->bmRequest & USB_REQ_TYPE_MASK)
|
||||||
{
|
{
|
||||||
@ -386,6 +387,7 @@ static uint8_t USBD_HID_Setup (USBD_HandleTypeDef *pdev,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case USB_REQ_GET_DESCRIPTOR:
|
case USB_REQ_GET_DESCRIPTOR:
|
||||||
|
req->wLength = req->wLength & 0x7f;
|
||||||
if(req->wValue >> 8 == HID_REPORT_DESC)
|
if(req->wValue >> 8 == HID_REPORT_DESC)
|
||||||
{
|
{
|
||||||
len = MIN(HID_FIDO_REPORT_DESC_SIZE , req->wLength);
|
len = MIN(HID_FIDO_REPORT_DESC_SIZE , req->wLength);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user