From bb0b9635f9d2a7643ecba1198b5bc23406086a85 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 15 Mar 2026 08:40:50 +0200 Subject: [PATCH] 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) --- src/term.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/term.c b/src/term.c index 4ed1f720db8..1d1fc05ac41 100644 --- a/src/term.c +++ b/src/term.c @@ -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)