From fcb7ad925dafe2d4f1966dede1ce41ad7430c1f1 Mon Sep 17 00:00:00 2001 From: emersion Date: Thu, 26 Apr 2018 15:58:41 +0100 Subject: [PATCH] layer-shell: fix use-after-free when client requests an invalid layer --- types/wlr_layer_shell.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/wlr_layer_shell.c b/types/wlr_layer_shell.c index 1fd0977b..86b67d7e 100644 --- a/types/wlr_layer_shell.c +++ b/types/wlr_layer_shell.c @@ -338,7 +338,7 @@ static void layer_shell_handle_get_layer_surface(struct wl_client *wl_client, surface->layer = layer; if (layer > ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY) { free(surface); - wl_resource_post_error(surface->resource, + wl_resource_post_error(client_resource, ZWLR_LAYER_SHELL_V1_ERROR_INVALID_LAYER, "Invalid layer %d", layer); return;