diff options
| author | CCHhui <[email protected]> | 2024-09-16 22:35:46 +0800 |
|---|---|---|
| committer | sakumisu <[email protected]> | 2024-09-16 23:11:45 +0800 |
| commit | d0fac3260a1702c96ee063500461a3dadb8eb32e (patch) | |
| tree | b381c1da17655f515ed96216ececdceef83f9ecb | |
| parent | e6fde5efab0acd68075f5f75b552eca4e4dbaa14 (diff) | |
fix(core/usbh_core): Fix raw_config_desc heap out of boundsv1.4.0
| -rw-r--r-- | core/usbh_core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/usbh_core.c b/core/usbh_core.c index cbdaecb7..2429b981 100644 --- a/core/usbh_core.c +++ b/core/usbh_core.c @@ -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"); |
