From 4f705f6f62185de6fa78b88b0aaec554a0fbf0de Mon Sep 17 00:00:00 2001 From: Alexandros Frantzis Date: Mon, 11 Apr 2022 12:53:50 +0300 Subject: [PATCH] win32u: Avoid iterating over a NULL window list when broadcasting. Signed-off-by: Alexandros Frantzis Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- dlls/win32u/message.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index 46c42188d70..9479595ae53 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -2508,9 +2508,11 @@ static BOOL is_message_broadcastable( UINT msg ) */ static BOOL broadcast_message( struct send_message_info *info, DWORD_PTR *res_ptr ) { - if (is_message_broadcastable( info->msg )) + HWND *list; + + if (is_message_broadcastable( info->msg ) && + (list = list_window_children( 0, get_desktop_window(), NULL, 0 ))) { - HWND *list = list_window_children( 0, get_desktop_window(), NULL, 0 ); int i; for (i = 0; list[i]; i++)