From cd06fa402b188f2743632c0387fd988aaf2d2fcf Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Mon, 22 Dec 2014 17:52:06 +0100 Subject: [PATCH] CID1108404: missing array inintialization BuildReportList checks that the array does not already holds the reports before adding them. If one of the uninitialized elements happened to be the address of one of the reports, it would not get added again, possibly leading to items in the array being in the wrong order. Just be safe and clear the array. Fixes #10221, patch there not used as it cluttered the code more than needed. --- .../kernel/drivers/input/usb_hid/TabletProtocolHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/add-ons/kernel/drivers/input/usb_hid/TabletProtocolHandler.cpp b/src/add-ons/kernel/drivers/input/usb_hid/TabletProtocolHandler.cpp index c5507c554c..48891589d8 100644 --- a/src/add-ons/kernel/drivers/input/usb_hid/TabletProtocolHandler.cpp +++ b/src/add-ons/kernel/drivers/input/usb_hid/TabletProtocolHandler.cpp @@ -147,7 +147,7 @@ TabletProtocolHandler::AddHandlers(HIDDevice &device, HIDCollection &collection, return; uint32 inputReportCount = 0; - HIDReport *inputReports[maxReportCount]; + HIDReport *inputReports[maxReportCount] = {0}; collection.BuildReportList(HID_REPORT_TYPE_INPUT, inputReports, inputReportCount);