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.
merge-requests/8/head
Eric Curtin 2 years ago committed by Caleb Connolly
parent 9d7600df51
commit 20572c1417
  1. 2
      bootctrl_impl.cpp

@ -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];
} }

Loading…
Cancel
Save