mirror of
https://github.com/swaywm/sway.git
synced 2026-02-04 04:06:18 -05:00
tiling_resize: fix use-after-free on view unmap during resize
Closing a tiled window (mod+shift+q) while resizing (mod+click) causes
an use-after-free in handle_unref.
Both conditions can be true in this case, which will result in
dereferencing `e` on the second check after it has already been freed by
the first `seatop_begin_default`.
Fix by combining separate checks for the main container and its
horizontal/vertical siblings into a single condition.
The second check was added in 9e272a7986
and I've checked that this fix does not regress that issue.
This commit is contained in:
parent
fa81ce8ee6
commit
238f0d4a8b
1 changed files with 1 additions and 4 deletions
|
|
@ -105,10 +105,7 @@ static void handle_pointer_motion(struct sway_seat *seat, uint32_t time_msec) {
|
|||
|
||||
static void handle_unref(struct sway_seat *seat, struct sway_container *con) {
|
||||
struct seatop_resize_tiling_event *e = seat->seatop_data;
|
||||
if (e->con == con) {
|
||||
seatop_begin_default(seat);
|
||||
}
|
||||
if (e->h_sib == con || e->v_sib == con) {
|
||||
if (e->con == con || e->h_sib == con || e->v_sib == con) {
|
||||
seatop_begin_default(seat);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue