1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-13 19:40:31 +03:00

[H7][LIB][USB] Middlewares change: Fix memory corruption

Application of
[H7] USB LIB Middlewares change: Avoid null hhid from being deferenced
to V1.4.0
This commit is contained in:
jflyper 2019-06-25 23:02:49 +09:00
parent c6321190a9
commit 8bbc1456f3

View file

@ -531,7 +531,7 @@ uint8_t USBD_HID_SendReport (USBD_HandleTypeDef *pdev,
{ {
USBD_HID_HandleTypeDef *hhid = (USBD_HID_HandleTypeDef*)pdev->pHID_ClassData; 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) if(hhid->state == HID_IDLE)
{ {