From c77f258b4a51097959e9eb024a95c728bc11b612 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20Krezovi=C4=87?= Date: Thu, 23 Jun 2016 11:59:32 +0200 Subject: [PATCH] desktop-shell: Avoid NULL pointer dereference MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When there are no outputs present, an output pointer can be NULL. Dereferencing such pointer will result in a crash. Reviewed-by: Quentin Glidic Reviewed-by: Pekka Paalanen Signed-off-by: Armin Krezović --- desktop-shell/shell.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c index 7deba5550..825c6c33b 100644 --- a/desktop-shell/shell.c +++ b/desktop-shell/shell.c @@ -2290,7 +2290,7 @@ shell_surface_set_class(struct wl_client *client, static void restore_output_mode(struct weston_output *output) { - if (output->original_mode) + if (output && output->original_mode) weston_output_mode_switch_to_native(output); }