Skip to content

Commit

Permalink
fix bug in PackReport (#534)
Browse files Browse the repository at this point in the history
Data is pointer to array of HID_DATA structure.
Function advances pointer as it packs the report buffer.
At end of process the function attempts to go back through the buffer and update the IsDataSet member.
What it's actually doing is writing unexpected memory locations.

Fix is to store the head of the array and move back before walking again to set the bits.
  • Loading branch information
ebadger authored Aug 24, 2020
1 parent dbadff8 commit aaeca58
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hid/hclient/report.c
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ Routine Description:
ULONG i;
ULONG CurrReportID;
BOOLEAN result = FALSE;

PHID_DATA Head = Data;
/*
// All report buffers that are initially sent need to be zero'd out
*/
Expand Down Expand Up @@ -584,6 +584,7 @@ Routine Description:
// having been set.
*/

Data = Head;
for (i = 0; i < DataLength; i++, Data++)
{
if (CurrReportID == Data -> ReportID)
Expand Down

0 comments on commit aaeca58

Please sign in to comment.