From fc9838b15e8d4f0d5a80749902b1d190978caf9f Mon Sep 17 00:00:00 2001 From: Markus Ongyerth Date: Fri, 15 Feb 2019 21:01:52 +0100 Subject: [PATCH] Prevent NULL dereference in tablet_tool handler In case a tool was removed, but not yet destroyed by the client, the tool_client's tool can be NULL. We have to check that as well in the set_cursor handler to prevent using inert resources --- types/tablet_v2/wlr_tablet_v2_tool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/tablet_v2/wlr_tablet_v2_tool.c b/types/tablet_v2/wlr_tablet_v2_tool.c index 471673ae..5bb57028 100644 --- a/types/tablet_v2/wlr_tablet_v2_tool.c +++ b/types/tablet_v2/wlr_tablet_v2_tool.c @@ -23,7 +23,7 @@ static void handle_tablet_tool_v2_set_cursor(struct wl_client *client, struct wl_resource *surface_resource, int32_t hotspot_x, int32_t hotspot_y) { struct wlr_tablet_tool_client_v2 *tool = tablet_tool_client_from_resource(resource); - if (!tool) { + if (!tool || !tool->tool) { return; }