Fix segfault originating in get_suffix function

Some callers try to print the return value from here, printf %s NULL,
ends up being a segfault.
This commit is contained in:
Eric Curtin 2023-05-15 20:56:22 +01:00 committed by Caleb Connolly
parent 9d7600df51
commit 20572c1417

View File

@ -412,7 +412,7 @@ int mark_boot_successful(unsigned slot)
const char *get_suffix(unsigned slot) const char *get_suffix(unsigned slot)
{ {
if (boot_control_check_slot_sanity(slot) != 0) if (boot_control_check_slot_sanity(slot) != 0)
return NULL; return "";
else else
return slot_suffix_arr[slot]; return slot_suffix_arr[slot];
} }