From 20572c1417030908fac57ffb35288323034bc6b2 Mon Sep 17 00:00:00 2001 From: Eric Curtin Date: Mon, 15 May 2023 20:56:22 +0100 Subject: [PATCH] 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. --- bootctrl_impl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootctrl_impl.cpp b/bootctrl_impl.cpp index f13f296..d375631 100644 --- a/bootctrl_impl.cpp +++ b/bootctrl_impl.cpp @@ -412,7 +412,7 @@ int mark_boot_successful(unsigned slot) const char *get_suffix(unsigned slot) { if (boot_control_check_slot_sanity(slot) != 0) - return NULL; + return ""; else return slot_suffix_arr[slot]; }