mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	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
This commit is contained in:
		
							parent
							
								
									b455df3b91
								
							
						
					
					
						commit
						fc9838b15e
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
					@ -23,7 +23,7 @@ static void handle_tablet_tool_v2_set_cursor(struct wl_client *client,
 | 
				
			||||||
		struct wl_resource *surface_resource,
 | 
							struct wl_resource *surface_resource,
 | 
				
			||||||
		int32_t hotspot_x, int32_t hotspot_y) {
 | 
							int32_t hotspot_x, int32_t hotspot_y) {
 | 
				
			||||||
	struct wlr_tablet_tool_client_v2 *tool = tablet_tool_client_from_resource(resource);
 | 
						struct wlr_tablet_tool_client_v2 *tool = tablet_tool_client_from_resource(resource);
 | 
				
			||||||
	if (!tool) {
 | 
						if (!tool || !tool->tool) {
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue