[PATCH] winebus.sys: Use type and size of the current event, not the previous one.

Rémi Bernon rbernon at codeweavers.com
Mon Oct 4 03:23:39 CDT 2021


Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51831
Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
 dlls/winebus.sys/unixlib.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/winebus.sys/unixlib.c b/dlls/winebus.sys/unixlib.c
index 49a42ea04ad..be030255705 100644
--- a/dlls/winebus.sys/unixlib.c
+++ b/dlls/winebus.sys/unixlib.c
@@ -350,8 +350,8 @@ BOOL bus_event_queue_pop(struct list *queue, struct bus_event *event)
     tmp = LIST_ENTRY(entry, struct bus_event, entry);
     list_remove(entry);
 
-    if (event->type != BUS_EVENT_TYPE_INPUT_REPORT) size = sizeof(*event);
-    else size = offsetof(struct bus_event, input_report.buffer[event->input_report.length]);
+    if (tmp->type != BUS_EVENT_TYPE_INPUT_REPORT) size = sizeof(*tmp);
+    else size = offsetof(struct bus_event, input_report.buffer[tmp->input_report.length]);
 
     memcpy(event, tmp, size);
     free(tmp);
-- 
2.33.0




More information about the wine-devel mailing list