From 82278edf3cc39f24ae667abbe4e733132ab5c516 Mon Sep 17 00:00:00 2001 From: Kirill Primak Date: Mon, 22 Jan 2024 18:57:37 +0300 Subject: [PATCH] =?UTF-8?q?layer-shell:=20forbid=20set=5Fsize=20with=20val?= =?UTF-8?q?ues=20=E2=89=A5INT32=5FMAX?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit be1c48cbfb80469d2d75c24e661c34b3b828dcba) --- types/wlr_layer_shell_v1.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/types/wlr_layer_shell_v1.c b/types/wlr_layer_shell_v1.c index 37256db6c..fd19a6743 100644 --- a/types/wlr_layer_shell_v1.c +++ b/types/wlr_layer_shell_v1.c @@ -130,6 +130,12 @@ static void layer_surface_handle_set_size(struct wl_client *client, return; } + if (width > INT32_MAX || height > INT32_MAX) { + wl_client_post_implementation_error(client, + "zwlr_layer_surface_v1.set_size: width and height can't be greater than INT32_MAX"); + return; + } + if (surface->current.desired_width == width && surface->current.desired_height == height) { surface->pending.committed &= ~WLR_LAYER_SURFACE_V1_STATE_DESIRED_SIZE;