aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominique Martinet <asmadeus@codewreck.org>2018-06-30 10:03:26 +0900
committerDominique Martinet <asmadeus@codewreck.org>2018-06-30 11:38:21 +0900
commit4f7b1382d4ceb1ed308563809d485ea6c047f077 (patch)
treee40832ee883b5f654e79a5a0256f7515f0f6f6cf
parentf0d455f088510bf8a79aaccb2c67fc2a926b5b1a (diff)
wayland backend seat: fix NULL output check
The test was done after dereferencing output in pointer_handle_enter, just move it up one line. No reason pointer_handle_leave would not need the check if enter needs it, add it there. Found through static analysis.
-rw-r--r--backend/wayland/wl_seat.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/backend/wayland/wl_seat.c b/backend/wayland/wl_seat.c
index 8ed61409..d5001a51 100644
--- a/backend/wayland/wl_seat.c
+++ b/backend/wayland/wl_seat.c
@@ -38,10 +38,8 @@ static void pointer_handle_enter(void *data, struct wl_pointer *wl_pointer,
}
struct wlr_wl_output *output = wl_surface_get_user_data(surface);
+ assert(output);
struct wlr_wl_pointer *pointer = output_get_pointer(output);
- if (output == NULL) {
- return;
- }
output->enter_serial = serial;
backend->current_pointer = pointer;
@@ -56,6 +54,7 @@ static void pointer_handle_leave(void *data, struct wl_pointer *wl_pointer,
}
struct wlr_wl_output *output = wl_surface_get_user_data(surface);
+ assert(output);
output->enter_serial = 0;
if (backend->current_pointer == NULL ||