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.
This commit is contained in:
Adrien Destugues 2014-12-22 17:52:06 +01:00
parent d350b0f0d4
commit cd06fa402b

View File

@ -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);