:: commit 1b144eef2ef2c0a7393b7229cb19abcdf7766e32

Mintsuki <mintsuki@protonmail.com> — 2026-04-12 22:40

parents: 0e6b0e9aac

menu: Fix NULL dereference when DEFAULT_ENTRY is out of range with TIMEOUT=0

diff --git a/common/menu.c b/common/menu.c
index f6974860..4f2e73a9 100644
--- a/common/menu.c
+++ b/common/menu.c
@@ -1205,7 +1205,7 @@ noreturn void _menu(bool first_run) {
     }
 
     if (!skip_timeout && !timeout) {
-        if (max_entries == 0 || selected_menu_entry->sub != NULL) {
+        if (max_entries == 0 || selected_menu_entry == NULL || selected_menu_entry->sub != NULL) {
             quiet = false;
             print("Default entry is not valid or directory, booting to menu.\n");
             skip_timeout = true;
tab: 248 wrap: offon