From 52354f159f06ac8f29af0652b8c98cefccc208cd Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Tue, 2 Jul 2024 15:27:26 +0300 Subject: [PATCH] kiosk-shell: Don't assume a valid output Turns out kiosk_shell_output_set_active_surface_tree() requires having a valid output which as seen in the wild might not be case. Prevents an illegal dereference on an invalid shoutput. Fixes: #920 Signed-off-by: Marius Vlad --- kiosk-shell/kiosk-shell.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kiosk-shell/kiosk-shell.c b/kiosk-shell/kiosk-shell.c index d02e96d0..099478d9 100644 --- a/kiosk-shell/kiosk-shell.c +++ b/kiosk-shell/kiosk-shell.c @@ -963,8 +963,9 @@ desktop_surface_removed(struct weston_desktop_surface *desktop_surface, WESTON_ACTIVATE_FLAG_NONE); } else { kiosk_seat->focused_surface = NULL; - kiosk_shell_output_set_active_surface_tree(shoutput, - NULL); + if (shoutput) + kiosk_shell_output_set_active_surface_tree(shoutput, + NULL); } }