From 172ce0fc2c49cb1601395fa5f32da199f997a0cd Mon Sep 17 00:00:00 2001 From: jflyper Date: Sun, 19 Jan 2020 21:30:32 +0900 Subject: [PATCH] [H7][LIB][USB] Middlewares change: Fix memory corruption Application of [H7] USB LIB Middlewares change: Avoid null hhid from being deferenced to V1.6.0 --- .../ST/STM32_USB_Device_Library/Class/HID/Src/usbd_hid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/main/STM32H7/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Src/usbd_hid.c b/lib/main/STM32H7/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Src/usbd_hid.c index fdfe7f2b0..5a8cc54b1 100755 --- a/lib/main/STM32H7/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Src/usbd_hid.c +++ b/lib/main/STM32H7/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) {