From d3c012245f5ec1819be0eb61f8d4b209a10d73e7 Mon Sep 17 00:00:00 2001 From: jflyper Date: Tue, 30 Jul 2019 01:52:13 +0900 Subject: [PATCH] [F7][LIB] Fix memory corruption in usbd_hid.c --- .../ST/STM32_USB_Device_Library/Class/HID/Src/usbd_hid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/main/STM32F7/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Src/usbd_hid.c b/lib/main/STM32F7/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Src/usbd_hid.c index 8c93f1ba9e..f2b94a2bf5 100755 --- a/lib/main/STM32F7/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Src/usbd_hid.c +++ b/lib/main/STM32F7/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Src/usbd_hid.c @@ -531,7 +531,7 @@ uint8_t USBD_HID_SendReport (USBD_HandleTypeDef *pdev, { USBD_HID_HandleTypeDef *hhid = (USBD_HID_HandleTypeDef*)pdev->pHID_ClassData; - if (pdev->dev_state == USBD_STATE_CONFIGURED ) + if (pdev->dev_state == USBD_STATE_CONFIGURED && hhid) { if(hhid->state == HID_IDLE) {