Skip to content

Commit 3c272f1

Browse files
committed
menu: Fix NULL dereference when DEFAULT_ENTRY is out of range with TIMEOUT=0
1 parent 6316c6a commit 3c272f1

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
@@ -1322,7 +1322,7 @@ noreturn void _menu(bool first_run) {
13221322
}
13231323

13241324
if (!skip_timeout && !timeout) {
1325-
if (max_entries == 0 || selected_menu_entry->sub != NULL) {
1325+
if (max_entries == 0 || selected_menu_entry == NULL || selected_menu_entry->sub != NULL) {
13261326
quiet = false;
13271327
print("Default entry is not valid or directory, booting to menu.\n");
13281328
skip_timeout = true;

0 commit comments

Comments
 (0)