[PATCH 0/1] MR6906: winebus: Ignore reports with unexpected IDs.
From: Rémi Bernon <rbernon(a)codeweavers.com> Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57463 --- dlls/winebus.sys/main.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/dlls/winebus.sys/main.c b/dlls/winebus.sys/main.c index 2522e2e6b8b..5b971473bb7 100644 --- a/dlls/winebus.sys/main.c +++ b/dlls/winebus.sys/main.c @@ -535,6 +535,17 @@ static void process_hid_report(DEVICE_OBJECT *device, BYTE *report_buf, DWORD re struct hid_report *report, *last_report; IRP *irp; + TRACE("device %p report_buf %p (%#x), report_len %#lx\n", device, report_buf, *report_buf, report_len); + + if (!ext->collection_desc.ReportIDs[0].ReportID) last_report = ext->last_reports[0]; + else last_report = ext->last_reports[report_buf[0]]; + + if (!last_report) + { + WARN("Ingoring report with unexpected id %#x\n", *report_buf); + return; + } + if (!(report = RtlAllocateHeap(GetProcessHeap(), 0, size))) return; memcpy(report->buffer, report_buf, report_len); report->length = report_len; @@ -595,8 +606,6 @@ static void process_hid_report(DEVICE_OBJECT *device, BYTE *report_buf, DWORD re RtlEnterCriticalSection(&ext->cs); list_add_tail(&ext->reports, &report->entry); - if (!ext->collection_desc.ReportIDs[0].ReportID) last_report = ext->last_reports[0]; - else last_report = ext->last_reports[report_buf[0]]; memcpy(last_report->buffer, report_buf, report_len); if ((irp = pop_pending_read(ext))) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/6906
participants (1)
-
Rémi Bernon