hidclass.sys: Prevent buffer overrun.

Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
stable
Aric Stewart 2019-02-06 10:23:07 -06:00 committed by Alexandre Julliard
parent b16fb11890
commit 5040b8d534
1 changed files with 1 additions and 2 deletions

View File

@ -838,8 +838,7 @@ static WINE_HIDP_PREPARSED_DATA* build_PreparseData(
if (features[0]->caps.ReportID != 0)
{
unsigned int *report_ids;
unsigned int cnt = max(i_count, o_count);
cnt = max(cnt, f_count);
unsigned int cnt = i_count + o_count + f_count;
report_ids = HeapAlloc(GetProcessHeap(), 0 , sizeof(*report_ids) * cnt);
if (i_count)