mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	menu: reset parser state in menu_finish()
				
					
				
			This fixes use-after-free in `fill_item()` on Reconfigure with
invalid `menu.xml` like below:
<openbox_menu>
  <menu id="root-menu">
    <item id="rofi-run" label="Run command">
      <action name="Execute" command="rofi-run" />
    </item>
  </menu>
</openbox_menu>
			
			
This commit is contained in:
		
							parent
							
								
									8d4f295440
								
							
						
					
					
						commit
						95dc4ac4b5
					
				
					 1 changed files with 5 additions and 0 deletions
				
			
		| 
						 | 
					@ -960,6 +960,11 @@ void
 | 
				
			||||||
menu_finish(struct server *server)
 | 
					menu_finish(struct server *server)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	menu_free_from(server, NULL);
 | 
						menu_free_from(server, NULL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/* Reset state vars for starting fresh when Reload is triggered */
 | 
				
			||||||
 | 
						current_item = NULL;
 | 
				
			||||||
 | 
						current_item_action = NULL;
 | 
				
			||||||
 | 
						current_menu = NULL;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Sets selection (or clears selection if passing NULL) */
 | 
					/* Sets selection (or clears selection if passing NULL) */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue