1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-25 17:25:20 +03:00

Merge pull request #7808 from hydra/bf-fix-crash-bug-1

Fix memory corruption in USB code.
This commit is contained in:
Michael Keller 2019-03-18 00:12:43 +13:00 committed by GitHub
commit df0d132d33
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -398,7 +398,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)
{ {