aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2019-04-23 22:33:31 +0300
committerDrew DeVault <sir@cmpwn.com>2019-04-23 14:36:12 -0600
commit933208837d5bc4a7a5fa0f6d4d6a38313fdae06a (patch)
tree7886123f064be7fbb5771d956c158c41c420f18d
parentf42816ce3f702be8a56696bc5d771a1cc9f63d8a (diff)
backend/wayland: fix wlr_wl_pointer use-after-free
-rw-r--r--backend/wayland/wl_seat.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/backend/wayland/wl_seat.c b/backend/wayland/wl_seat.c
index 6c8eb4f3..6648f97e 100644
--- a/backend/wayland/wl_seat.c
+++ b/backend/wayland/wl_seat.c
@@ -331,6 +331,11 @@ struct wlr_wl_pointer *pointer_get_wl(struct wlr_pointer *wlr_pointer) {
static void pointer_destroy(struct wlr_pointer *wlr_pointer) {
struct wlr_wl_pointer *pointer = pointer_get_wl(wlr_pointer);
+
+ if (pointer->output->backend->current_pointer == pointer) {
+ pointer->output->backend->current_pointer = NULL;
+ }
+
wl_list_remove(&pointer->output_destroy.link);
free(pointer);
}