aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominique Martinet <asmadeus@codewreck.org>2018-07-01 21:02:35 +0900
committerDominique Martinet <asmadeus@codewreck.org>2018-07-01 21:04:43 +0900
commit9ddc2f39d0e6b59cb4f5f8ed8b4961a40172bbc1 (patch)
treee569f6008ac49d886d6396dc51b783d8d56f047e
parent07209d062c919225af70df2caa75fffe5921cb97 (diff)
wlr_seat destroy: fix use-after-free after primary selection source cancel
the primary_selection_source_destroy list points to memory freed by that cancel callback, so remove from list before freeing
-rw-r--r--types/seat/wlr_seat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/types/seat/wlr_seat.c b/types/seat/wlr_seat.c
index ead4b0e7..c9eecef6 100644
--- a/types/seat/wlr_seat.c
+++ b/types/seat/wlr_seat.c
@@ -168,9 +168,9 @@ void wlr_seat_destroy(struct wlr_seat *seat) {
seat->selection_source = NULL;
}
if (seat->primary_selection_source) {
+ wl_list_remove(&seat->primary_selection_source_destroy.link);
seat->primary_selection_source->cancel(seat->primary_selection_source);
seat->primary_selection_source = NULL;
- wl_list_remove(&seat->primary_selection_source_destroy.link);
}
struct wlr_seat_client *client, *tmp;