From 392d54a35d34ff08baaffdd50b9d11072481706e Mon Sep 17 00:00:00 2001 From: emersion Date: Tue, 13 Feb 2018 23:48:46 +0100 Subject: Wrap wl_resource_get_user_data into safer helper functions This ensures we're not incorrectly casting a resource. Fixes #628 --- xwayland/xwm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xwayland') diff --git a/xwayland/xwm.c b/xwayland/xwm.c index 10bc2e30..94dfdaab 100644 --- a/xwayland/xwm.c +++ b/xwayland/xwm.c @@ -742,7 +742,7 @@ static void xwm_handle_surface_id_message(struct wlr_xwm *xwm, struct wl_resource *resource = wl_client_get_object(xwm->xwayland->client, id); if (resource) { - struct wlr_surface *surface = wl_resource_get_user_data(resource); + struct wlr_surface *surface = wlr_surface_from_resource(resource); xsurface->surface_id = 0; xwm_map_shell_surface(xwm, xsurface, surface); } else { -- cgit v1.2.3