diff options
| author | CCHhui <[email protected]> | 2024-09-16 22:35:46 +0800 |
|---|---|---|
| committer | sakumisu <[email protected]> | 2024-09-16 22:48:35 +0800 |
| commit | 171b36e766d36e647c3f7531e8460bb26dab105e (patch) | |
| tree | 1c15799dc3684187539a1ee4c29d93f33a09a096 | |
| parent | 0371bb921c31e7382e199238586b3ef37fd1a029 (diff) | |
fix(core/usbh_core): Fix raw_config_desc heap out of bounds
| -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"); |
