From 6447bda0efad694b06b18c4cf9182482be427ef8 Mon Sep 17 00:00:00 2001
From: Dean Camera <dean@fourwalledcubicle.com>
Date: Sun, 17 Jun 2018 15:39:20 +1000
Subject: [PATCH] Fixed HID report parser corruption when parsing PUSH and POP
 report item elements.

---
 LUFA/DoxygenPages/ChangeLog.txt           | 1 +
 LUFA/Drivers/USB/Class/Common/HIDParser.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/LUFA/DoxygenPages/ChangeLog.txt b/LUFA/DoxygenPages/ChangeLog.txt
index 251055b47..e1424c5f9 100644
--- a/LUFA/DoxygenPages/ChangeLog.txt
+++ b/LUFA/DoxygenPages/ChangeLog.txt
@@ -25,6 +25,7 @@
   *   - Fixed incorrect endpoint bank setup on the UC3 architecture (thanks to Andrus Aaslaid)
   *   - Fixed CDC_Device_Send*_P() and CDC_Host_Send*_P() variant functions not compiled out for UC3 architecture
   *   - Fixed USB_STRING_DESCRIPTOR_ARRAY() not accepting more than two byte long arrays
+  *   - Fixed HID report parser corruption when parsing PUSH and POP report item elements
   *  - Library Applications:
   *   - Fixed bootloaders not disabling global interrupts during erase and write operations (thanks to Zoltan)
   *   - Fixed bootloaders accepting flash writes to the bootloader region (thanks to NicoHood)
diff --git a/LUFA/Drivers/USB/Class/Common/HIDParser.c b/LUFA/Drivers/USB/Class/Common/HIDParser.c
index 04fd7609e..87eaf7c67 100644
--- a/LUFA/Drivers/USB/Class/Common/HIDParser.c
+++ b/LUFA/Drivers/USB/Class/Common/HIDParser.c
@@ -92,7 +92,7 @@ uint8_t USB_ProcessHIDReport(const uint8_t* ReportData,
 
 				memcpy((CurrStateTable + 1),
 				       CurrStateTable,
-				       sizeof(HID_ReportItem_t));
+				       sizeof(HID_StateTable_t));
 
 				CurrStateTable++;
 				break;
-- 
GitLab