From cf94b3f5fc6efdfc25b7c434852f4b04af2dddc7 Mon Sep 17 00:00:00 2001 From: "Cynventria[CitRA]" <45027522+Cynventria@users.noreply.github.com> Date: Mon, 10 Mar 2025 14:22:29 +0800 Subject: [PATCH] fix desc_end in vendord_open() minor fix on calculation of desc_end in vendord_open( ) for descriptor prasing --- src/class/vendor/vendor_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/class/vendor/vendor_device.c b/src/class/vendor/vendor_device.c index 6f9b4853f..2fc0ac944 100644 --- a/src/class/vendor/vendor_device.c +++ b/src/class/vendor/vendor_device.c @@ -197,7 +197,7 @@ void vendord_reset(uint8_t rhport) { uint16_t vendord_open(uint8_t rhport, const tusb_desc_interface_t* desc_itf, uint16_t max_len) { TU_VERIFY(TUSB_CLASS_VENDOR_SPECIFIC == desc_itf->bInterfaceClass, 0); const uint8_t* p_desc = tu_desc_next(desc_itf); - const uint8_t* desc_end = p_desc + max_len; + const uint8_t* desc_end = (uint8_t const*)desc_itf + max_len; // Find available interface vendord_interface_t* p_vendor = NULL;