From: "Rémi Bernon" Subject: [PATCH] winebus.sys: Use type and size of the current event, not the previous one. Message-Id: <20211004082339.3496172-1-rbernon@codeweavers.com> Date: Mon, 4 Oct 2021 10:23:39 +0200 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51831 Signed-off-by: Rémi Bernon --- 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