From 8cca287683a4376f7483b579dcf36c2d1daf8fab Mon Sep 17 00:00:00 2001 From: Nathan Conrad Date: Thu, 12 Sep 2019 16:03:45 -0400 Subject: [PATCH] Add verification that there is enough buffer space for HID OUT control transfer. --- src/class/hid/hid_device.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/class/hid/hid_device.c b/src/class/hid/hid_device.c index 572f2cad2..7270904ca 100644 --- a/src/class/hid/hid_device.c +++ b/src/class/hid/hid_device.c @@ -230,6 +230,7 @@ bool hidd_control_request(uint8_t rhport, tusb_control_request_t const * p_reque break; case HID_REQ_CONTROL_SET_REPORT: + TU_VERIFY(p_request->wLength <=sizeof(p_hid->epout_buf)); tud_control_xfer(rhport, p_request, p_hid->epout_buf, p_request->wLength); break;