From 7719e33e68da9ea3b8105f7a557ab7fb24b9ddf8 Mon Sep 17 00:00:00 2001 From: Vasilis Liaskovitis Date: Wed, 22 May 2019 16:15:34 +0200 Subject: [PATCH] wayland/pointer-constraints: Reject invalid lifetime https://gitlab.gnome.org/GNOME/mutter/issues/425 --- src/wayland/meta-wayland-pointer-constraints.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/wayland/meta-wayland-pointer-constraints.c b/src/wayland/meta-wayland-pointer-constraints.c index a33b672f1..aa59dbcb4 100644 --- a/src/wayland/meta-wayland-pointer-constraints.c +++ b/src/wayland/meta-wayland-pointer-constraints.c @@ -862,6 +862,19 @@ init_pointer_constraint (struct wl_resource *resource, return; } + switch (lifetime) + { + case ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_ONESHOT: + case ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_PERSISTENT: + break; + + default: + wl_resource_post_error (resource, + WL_DISPLAY_ERROR_INVALID_OBJECT, + "Invalid constraint lifetime"); + return; + } + constraint = meta_wayland_pointer_constraint_new (surface, seat, region, lifetime,