[PATCH 0/1] MR869: win32u: Copy directly into the union pointer in unpack_message().
This is a gcc bug; I've filed the following bug report: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106904 -- https://gitlab.winehq.org/wine/wine/-/merge_requests/869
From: Zebediah Figura <zfigura(a)codeweavers.com> This works around a spurious gcc warning: ../wine/dlls/win32u/message.c: In function ‘unpack_message.constprop’: ../wine/dlls/win32u/message.c:359:9: error: writing 28 bytes into a region of size 4 [-Werror=stringop-overflow=] 359 | memcpy( &ps->wp, &wp, sizeof(wp) ); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from ../wine/dlls/win32u/win32u_private.h:29, from ../wine/dlls/win32u/message.c:30: ../wine/include/ntuser.h:549:15: note: destination object ‘hwnd’ of size 4 549 | UINT hwnd; | ^~~~ --- dlls/win32u/message.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index f4f134e213b..57e9b26b33d 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -356,7 +356,7 @@ static BOOL unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lpa wp.cx = ps->wp.cx; wp.cy = ps->wp.cy; wp.flags = ps->wp.flags; - memcpy( &ps->wp, &wp, sizeof(wp) ); + memcpy( ps, &wp, sizeof(wp) ); break; } case WM_WINE_KEYBOARD_LL_HOOK: -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/869
participants (2)
-
Zebediah Figura -
Zebediah Figura (@zfigura)