Skip to content

Commit

Permalink
fix(core/usbh_core): Fix raw_config_desc heap out of bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
CutClassH authored and sakumisu committed Sep 16, 2024
1 parent e6fde5e commit d0fac32
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/usbh_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ int usbh_enumerate(struct usbh_hubport *hport)
goto errout;
}
USB_LOG_INFO("The device has %d interfaces\r\n", ((struct usb_configuration_descriptor *)ep0_request_buffer[hport->bus->busid])->bNumInterfaces);
hport->raw_config_desc = usb_osal_malloc(wTotalLength);
hport->raw_config_desc = usb_osal_malloc(wTotalLength + 1);
if (hport->raw_config_desc == NULL) {
ret = -USB_ERR_NOMEM;
USB_LOG_ERR("No memory to alloc for raw_config_desc\r\n");
Expand Down

0 comments on commit d0fac32

Please sign in to comment.