Skip to content

Commit d0fac32

Browse files
CutClassHsakumisu
authored andcommitted
fix(core/usbh_core): Fix raw_config_desc heap out of bounds
1 parent e6fde5e commit d0fac32

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/usbh_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ int usbh_enumerate(struct usbh_hubport *hport)
486486
goto errout;
487487
}
488488
USB_LOG_INFO("The device has %d interfaces\r\n", ((struct usb_configuration_descriptor *)ep0_request_buffer[hport->bus->busid])->bNumInterfaces);
489-
hport->raw_config_desc = usb_osal_malloc(wTotalLength);
489+
hport->raw_config_desc = usb_osal_malloc(wTotalLength + 1);
490490
if (hport->raw_config_desc == NULL) {
491491
ret = -USB_ERR_NOMEM;
492492
USB_LOG_ERR("No memory to alloc for raw_config_desc\r\n");

0 commit comments

Comments
 (0)