aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Ongyerth <ongy@ongy.net>2019-02-15 21:01:52 +0100
committeremersion <contact@emersion.fr>2019-02-19 08:51:10 +0100
commitfc9838b15e8d4f0d5a80749902b1d190978caf9f (patch)
treecba0eb8c8cf95c2be1a4b672c963e7592ecdb632
parentb455df3b9172286f7af137ffdc7b0b5735e9ddb3 (diff)
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
-rw-r--r--types/tablet_v2/wlr_tablet_v2_tool.c2
1 files changed, 1 insertions, 1 deletions
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;
}