mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 12:55:58 +01:00
Fix possible crash in server-decoration when surface destroyed
If the underlying surface is destroyed, but the client has not yet destroyed the server decoration object, and then tries to call request_mode() on it, the compositor will crash, because the wlr_server_decoration struct has been freed, and the wl_resource's user_data member has been NULLed out. Yes, this is certainly an error for the client to do that, but I shouldn't be able to write a buggy (or malicious) Wayland app that can take down the entire compositor.
This commit is contained in:
parent
1a731596c5
commit
eacb4cf6d2
1 changed files with 1 additions and 1 deletions
|
@ -24,7 +24,7 @@ static void server_decoration_handle_request_mode(struct wl_client *client,
|
||||||
struct wl_resource *resource, uint32_t mode) {
|
struct wl_resource *resource, uint32_t mode) {
|
||||||
struct wlr_server_decoration *decoration =
|
struct wlr_server_decoration *decoration =
|
||||||
decoration_from_resource(resource);
|
decoration_from_resource(resource);
|
||||||
if (decoration->mode == mode) {
|
if (decoration == NULL || decoration->mode == mode) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
decoration->mode = mode;
|
decoration->mode = mode;
|
||||||
|
|
Loading…
Reference in a new issue