mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	seat: Fix use-after-free in touch_finish()
This commit is contained in:
		
							parent
							
								
									086a887058
								
							
						
					
					
						commit
						a3fbb52bb0
					
				
					 1 changed files with 6 additions and 1 deletions
				
			
		| 
						 | 
					@ -317,8 +317,13 @@ seat_finish(struct server *server)
 | 
				
			||||||
	struct seat *seat = &server->seat;
 | 
						struct seat *seat = &server->seat;
 | 
				
			||||||
	wl_list_remove(&seat->new_input.link);
 | 
						wl_list_remove(&seat->new_input.link);
 | 
				
			||||||
	keyboard_finish(seat);
 | 
						keyboard_finish(seat);
 | 
				
			||||||
	cursor_finish(seat);
 | 
						/*
 | 
				
			||||||
 | 
						 * Caution - touch_finish() unregisters event listeners from
 | 
				
			||||||
 | 
						 * seat->cursor and must come before cursor_finish(), otherwise
 | 
				
			||||||
 | 
						 * a use-after-free occurs.
 | 
				
			||||||
 | 
						 */
 | 
				
			||||||
	touch_finish(seat);
 | 
						touch_finish(seat);
 | 
				
			||||||
 | 
						cursor_finish(seat);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue