mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-30 00:15:58 +01:00
layer-shell: fix use-after-free when client requests an invalid layer
This commit is contained in:
parent
ce64bb7d83
commit
fcb7ad925d
1 changed files with 1 additions and 1 deletions
|
@ -338,7 +338,7 @@ static void layer_shell_handle_get_layer_surface(struct wl_client *wl_client,
|
||||||
surface->layer = layer;
|
surface->layer = layer;
|
||||||
if (layer > ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY) {
|
if (layer > ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY) {
|
||||||
free(surface);
|
free(surface);
|
||||||
wl_resource_post_error(surface->resource,
|
wl_resource_post_error(client_resource,
|
||||||
ZWLR_LAYER_SHELL_V1_ERROR_INVALID_LAYER,
|
ZWLR_LAYER_SHELL_V1_ERROR_INVALID_LAYER,
|
||||||
"Invalid layer %d", layer);
|
"Invalid layer %d", layer);
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue