Avoid segfaults in TTY menu-item selection

* src/term.c (tty_menu_show): Don't allow "selection" of items in
a bogus menu.  (Bug#80603)
This commit is contained in:
Eli Zaretskii
2026-03-15 08:40:50 +02:00
parent f59181008f
commit bb0b9635f9

View File

@@ -4079,6 +4079,9 @@ tty_menu_show (struct frame *f, int x, int y, int menuflags,
status = tty_menu_activate (menu, &pane, &selidx, x, y, &datap,
tty_menu_help_callback,
menuflags & MENU_KBD_NAVIGATION);
if (status == TTYM_SUCCESS && !VECTORP (menu_items))
status = TTYM_IA_SELECT;
entry = pane_prefix = Qnil;
switch (status)