aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Primak <vyivel@eclair.cafe>2024-01-22 18:57:37 +0300
committerKirill Primak <vyivel@eclair.cafe>2024-01-22 19:01:57 +0300
commitbe1c48cbfb80469d2d75c24e661c34b3b828dcba (patch)
treea106dbf0d2be50679a3b78ebc14b55473f87b3e9
parent0b090c83fb5b5c5741d9a9566a499eabbe079f38 (diff)
layer-shell: forbid set_size with values ≥INT32_MAX
-rw-r--r--types/wlr_layer_shell_v1.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/types/wlr_layer_shell_v1.c b/types/wlr_layer_shell_v1.c
index 3bb3b91d..ebdf54aa 100644
--- a/types/wlr_layer_shell_v1.c
+++ b/types/wlr_layer_shell_v1.c
@@ -131,6 +131,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->pending.desired_width == width
&& surface->pending.desired_height == height) {
return;