Skip to contentSkip to conversation

Input: gtco - fix uninitialized stack read

PATCH New Paul Hollinsky 1 participant 1 message Aug 15, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Input: gtco - fix uninitialized stack read

If a malformed HID report is sent from the device, a prefix with TYPE_MAIN may read globtype before it is written with TYPE_GLOBAL.

The oldval array is protected from uninitialized read by the indent counter.

---
 drivers/input/tablet/gtco.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/tablet/gtco.c +1 -1
index 44bb1f69b4b2..db030cd043d5 100644
@@ -217,7 +217,7 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report,
 	__u32 usage = 0;
 
 	/* Global Values, indexed by TAG */
-	__u32 globalval[TAG_GLOB_MAX];
+	__u32 globalval[TAG_GLOB_MAX] = { 0 };
 	__u32 oldval[TAG_GLOB_MAX];
 
 	/* Debug stuff */
Signature · 1 line
2.25.1