Module: wine Branch: master Commit: 6bc71db09e95ce66142c2887b6fe23f59c63dd3f URL: https://source.winehq.org/git/wine.git/?a=commit;h=6bc71db09e95ce66142c2887b... Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Oct 4 10:23:39 2021 +0200 winebus.sys: Use type and size of the current event, not the previous one. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51831 Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- 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 177b8f5ba70..29537170df7 100644 --- a/dlls/winebus.sys/unixlib.c +++ b/dlls/winebus.sys/unixlib.c @@ -364,8 +364,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);