diff --git a/xmenu.c b/xmenu.c index afb4301..a4c29e1 100644 --- a/xmenu.c +++ b/xmenu.c @@ -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) ; + /* 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; menu->caller = item; item->submenu = menu;