summaryrefslogtreecommitdiff
path: root/class/aoa
diff options
context:
space:
mode:
Diffstat (limited to 'class/aoa')
-rw-r--r--class/aoa/usbh_aoa.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/class/aoa/usbh_aoa.c b/class/aoa/usbh_aoa.c
index 22426dad..571d2458 100644
--- a/class/aoa/usbh_aoa.c
+++ b/class/aoa/usbh_aoa.c
@@ -180,6 +180,11 @@ int usbh_aoa_send_hid_event(struct usbh_aoa *aoa_class, uint16_t id, uint8_t *ev
if (!aoa_class || !aoa_class->hport) {
return -USB_ERR_INVAL;
}
+
+ if (event_len > sizeof(g_aoa_buffer)) {
+ return -USB_ERR_INVAL;
+ }
+
setup = aoa_class->hport->setup;
setup->bmRequestType = USB_REQUEST_DIR_OUT | USB_REQUEST_VENDOR | USB_REQUEST_RECIPIENT_DEVICE;