From: Zbigniew Jędrzejewski-Szmek Date: Fri, 6 May 2022 12:38:16 +0000 (+0200) Subject: shared/bootspec: add one more assert X-Git-Tag: v251-rc3~39^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec725c0c498c3db7fbe910c6593b342ad2369904;p=thirdparty%2Fsystemd.git shared/bootspec: add one more assert All callers assume that boot_entry_title() always returns something. It will, as long as it's not called on an uninitialized entry. --- diff --git a/src/shared/bootspec.h b/src/shared/bootspec.h index 93fb22e9d40..56e06f6be9a 100644 --- a/src/shared/bootspec.h +++ b/src/shared/bootspec.h @@ -92,5 +92,5 @@ int boot_config_select_special_entries(BootConfig *config); static inline const char* boot_entry_title(const BootEntry *entry) { assert(entry); - return entry->show_title ?: entry->title ?: entry->id; + return ASSERT_PTR(entry->show_title ?: entry->title ?: entry->id); }