From 2c3849be91338b0f4d27d264b6a122078f0ffb63 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 25 Nov 2013 18:01:45 +0000 Subject: [PATCH] shell: Fix a potential NULL pointer dereference get_shell_surface() may return NULL. Found by scan-build. --- src/shell.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/shell.c b/src/shell.c index abed1c7e3..804a57e6c 100644 --- a/src/shell.c +++ b/src/shell.c @@ -1373,7 +1373,8 @@ take_surface_to_workspace_by_seat(struct desktop_shell *shell, workspace_has_only(to, surface)) update_workspace(shell, index, from, to); else { - if (wl_list_empty(&shsurf->workspace_transform.link)) + if (shsurf != NULL && + wl_list_empty(&shsurf->workspace_transform.link)) wl_list_insert(&shell->workspaces.anim_sticky_list, &shsurf->workspace_transform.link);