seat: Fix use-after-free in touch_finish()

This commit is contained in:
John Lindgren 2022-09-15 20:02:06 -04:00 committed by Consolatis
parent 086a887058
commit a3fbb52bb0

View file

@ -317,8 +317,13 @@ seat_finish(struct server *server)
struct seat *seat = &server->seat; struct seat *seat = &server->seat;
wl_list_remove(&seat->new_input.link); wl_list_remove(&seat->new_input.link);
keyboard_finish(seat); keyboard_finish(seat);
cursor_finish(seat); /*
* Caution - touch_finish() unregisters event listeners from
* seat->cursor and must come before cursor_finish(), otherwise
* a use-after-free occurs.
*/
touch_finish(seat); touch_finish(seat);
cursor_finish(seat);
} }
void void