mirror of
https://github.com/sakumisu/CherryUSB.git
synced 2025-05-09 00:21:44 +08:00
fix(core/usbh_core): Fix raw_config_desc heap out of bounds
This commit is contained in:
parent
0371bb921c
commit
171b36e766
@ -486,7 +486,7 @@ int usbh_enumerate(struct usbh_hubport *hport)
|
|||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
USB_LOG_INFO("The device has %d interfaces\r\n", ((struct usb_configuration_descriptor *)ep0_request_buffer[hport->bus->busid])->bNumInterfaces);
|
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) {
|
if (hport->raw_config_desc == NULL) {
|
||||||
ret = -USB_ERR_NOMEM;
|
ret = -USB_ERR_NOMEM;
|
||||||
USB_LOG_ERR("No memory to alloc for raw_config_desc\r\n");
|
USB_LOG_ERR("No memory to alloc for raw_config_desc\r\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user