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
1 changed files with 1 additions and 1 deletions

View File

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