]> git.mdlowis.com Git - proto/labwc.git/commit
menu: fix unexpected behavior when a menu is opened from another menu
authortokyo4j <hrak1529@gmail.com>
Fri, 24 Jan 2025 00:57:17 +0000 (09:57 +0900)
committerConsolatis <35009135+Consolatis@users.noreply.github.com>
Fri, 7 Feb 2025 16:58:55 +0000 (17:58 +0100)
commit4072a80eba3c1584c17eaf8e376d0424d0da216a
treebd351f81f6c7d5696cbf2ff9ad17f92c43800ae0
parent465488110d04f838583b778b3f7c26cc1f5c63bf
menu: fix unexpected behavior when a menu is opened from another menu

server->menu_current should be cleared before calling actions_run() as
it may internally call menu_open_root(). Clearing it after actions_run()
leads to an inconsistent state where a menu is opened but
server->menu_current is NULL. It even lead to a segfault when the item
opening another menu is contained in a pipemenu, because
menu_open_root() calls destroy_pipemenu() when server->menu_current is
set, which makes accessing item->actions a UAF.
src/menu/menu.c