Skip to content

Commit 1b144ee

Browse files
committed
menu: Fix NULL dereference when DEFAULT_ENTRY is out of range with TIMEOUT=0
1 parent 0e6b0e9 commit 1b144ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

common/menu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1205,7 +1205,7 @@ noreturn void _menu(bool first_run) {
12051205
}
12061206

12071207
if (!skip_timeout && !timeout) {
1208-
if (max_entries == 0 || selected_menu_entry->sub != NULL) {
1208+
if (max_entries == 0 || selected_menu_entry == NULL || selected_menu_entry->sub != NULL) {
12091209
quiet = false;
12101210
print("Default entry is not valid or directory, booting to menu.\n");
12111211
skip_timeout = true;

0 commit comments

Comments
 (0)