summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoyan Ding <stu_dby@126.com>2014-07-06 11:44:58 +0800
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>2014-08-19 16:24:58 +0300
commitc06a180dd574c24ca50766461c10d3a6bfa3ad2b (patch)
treeb6ac986fa8bfb83d895c45a7935405569baedcfe
parenta0fae4657fab4f1708449d5ee5e1b92e5e90c0aa (diff)
downloadweston-c06a180dd574c24ca50766461c10d3a6bfa3ad2b.tar.gz
xwm: check whether the picked seat can be NULL
The seat picked in weston_wm_window_handle_moveresize can sometimes be NULL when it is (somehow) triggered with all buttons released. This patch checks whether the seat is NULL to avoid NULL dereference. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=80837 Signed-off-by: Boyan Ding <stu_dby@126.com>
-rw-r--r--xwayland/window-manager.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xwayland/window-manager.c b/xwayland/window-manager.c
index 6cac2782..f1523f5a 100644
--- a/xwayland/window-manager.c
+++ b/xwayland/window-manager.c
@@ -1244,8 +1244,8 @@ weston_wm_window_handle_moveresize(struct weston_wm_window *window,
struct weston_shell_interface *shell_interface =
&wm->server->compositor->shell_interface;
- if (seat->pointer->button_count != 1 || !window->view
- || seat->pointer->focus != window->view)
+ if (seat == NULL || seat->pointer->button_count != 1
+ || !window->view || seat->pointer->focus != window->view)
return;
detail = client_message->data.data32[2];