Fix: Don't allow a separator as root for submenus.

This commit is contained in:
Tobias R. Henle 2021-04-05 21:27:48 +02:00
parent 60ddf397e3
commit 78cdb02be6

View File

@ -432,6 +432,10 @@ buildmenutree(unsigned level, const char *label, const char *output, char *file)
for (item = prevmenu->list; item->next != NULL; item = item->next) for (item = prevmenu->list; item->next != NULL; item = item->next)
; ;
/* a separator is no valid root for a submenu */
if (!item->label)
errx(1, "a separator is no valid root for a submenu");
prevmenu = menu; prevmenu = menu;
menu->caller = item; menu->caller = item;
item->submenu = menu; item->submenu = menu;