diff options
author | Dominique Martinet <asmadeus@codewreck.org> | 2018-04-13 14:56:58 +0900 |
---|---|---|
committer | Dominique Martinet <asmadeus@codewreck.org> | 2018-04-13 14:58:23 +0900 |
commit | 1fd21650d731ebed8ab8ebfc9e21526cdf162525 (patch) | |
tree | b8004218300f01de3115409bee2e4a7dda53eb23 /sway | |
parent | Merge branch 'master' of github.com:swaywm/sway (diff) | |
download | sway-1fd21650d731ebed8ab8ebfc9e21526cdf162525.tar.gz sway-1fd21650d731ebed8ab8ebfc9e21526cdf162525.tar.zst sway-1fd21650d731ebed8ab8ebfc9e21526cdf162525.zip |
seat_set_focus_wrap: fix use-after-free when destroying last focused container
Diffstat (limited to 'sway')
-rw-r--r-- | sway/input/seat.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c index 467e5087..431460c4 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c | |||
@@ -491,6 +491,9 @@ void seat_set_focus_warp(struct sway_seat *seat, | |||
491 | ipc_event_workspace(last_ws, container, "focus"); | 491 | ipc_event_workspace(last_ws, container, "focus"); |
492 | if (!workspace_is_visible(last_ws) | 492 | if (!workspace_is_visible(last_ws) |
493 | && last_ws->children->length == 0) { | 493 | && last_ws->children->length == 0) { |
494 | if (last_ws == last_focus) { | ||
495 | last_focus = NULL; | ||
496 | } | ||
494 | container_destroy(last_ws); | 497 | container_destroy(last_ws); |
495 | } | 498 | } |
496 | } | 499 | } |