aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/USB/Class/Device/HID.c
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-08-27 22:34:41 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-08-27 22:34:41 +0000
commit94c899d7b7b84cd170d75e1fbb4e696cf3447c27 (patch)
tree64c8d9d7c181ee3a3ca0e67137671a955820e6db /LUFA/Drivers/USB/Class/Device/HID.c
parent922e60192dc089654a82be0d789fb7a8ecc47039 (diff)
downloadlufa-94c899d7b7b84cd170d75e1fbb4e696cf3447c27.tar.gz
lufa-94c899d7b7b84cd170d75e1fbb4e696cf3447c27.tar.bz2
lufa-94c899d7b7b84cd170d75e1fbb4e696cf3447c27.zip
Fixed Device mode HID Class driver not explicitly initializing the ReportSize parameter to zero before calling callback routine, so that ignored callbacks don't cause incorrect data to be sent.
Diffstat (limited to 'LUFA/Drivers/USB/Class/Device/HID.c')
-rw-r--r--LUFA/Drivers/USB/Class/Device/HID.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/LUFA/Drivers/USB/Class/Device/HID.c b/LUFA/Drivers/USB/Class/Device/HID.c
index b44d4db63..a99c2647c 100644
--- a/LUFA/Drivers/USB/Class/Device/HID.c
+++ b/LUFA/Drivers/USB/Class/Device/HID.c
@@ -48,8 +48,8 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter
{
Endpoint_ClearSETUP();
- uint16_t ReportINSize;
- uint8_t ReportID = (USB_ControlRequest.wValue & 0xFF);
+ uint16_t ReportINSize = 0;
+ uint8_t ReportID = (USB_ControlRequest.wValue & 0xFF);
memset(HIDInterfaceInfo->Config.PrevReportINBuffer, 0, HIDInterfaceInfo->Config.PrevReportINBufferSize);
@@ -151,8 +151,8 @@ void HID_Device_USBTask(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo)
if (Endpoint_IsReadWriteAllowed())
{
uint8_t ReportINData[HIDInterfaceInfo->Config.PrevReportINBufferSize];
- uint8_t ReportID = 0;
- uint16_t ReportINSize;
+ uint8_t ReportID = 0;
+ uint16_t ReportINSize = 0;
memset(ReportINData, 0, sizeof(ReportINData));