Module: wine Branch: master Commit: 5040b8d534a4fa32a5b1e2653dd937553e94a61e URL: https://source.winehq.org/git/wine.git/?a=commit;h=5040b8d534a4fa32a5b1e2653...
Author: Aric Stewart aric@codeweavers.com Date: Wed Feb 6 10:23:07 2019 -0600
hidclass.sys: Prevent buffer overrun.
Signed-off-by: Aric Stewart aric@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/hidclass.sys/descriptor.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/dlls/hidclass.sys/descriptor.c b/dlls/hidclass.sys/descriptor.c index 6b84997..09f9401 100644 --- a/dlls/hidclass.sys/descriptor.c +++ b/dlls/hidclass.sys/descriptor.c @@ -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)