From e3f0338b53e2926f910aebc420ae2faa13e8b0fd Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 19 Feb 2025 13:35:00 -0500 Subject: Silence minor nit in load-options parsing debug output Previously when there were no load options, this would go in the debug log: load-options.c:313:parse_load_options() full load options: include/hexdump.h:92:vhexdumpf() hexdump of a NULL pointer! This changes it to say: load-options.c:315:parse_load_options() LoadOptions is empty Signed-off-by: Peter Jones --- load-options.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'load-options.c') diff --git a/load-options.c b/load-options.c index 091cb18b..660eaa91 100644 --- a/load-options.c +++ b/load-options.c @@ -311,8 +311,13 @@ parse_load_options(EFI_LOADED_IMAGE *li) UINT32 remaining_size; CHAR16 *loader_str = NULL; - dprint(L"full load options:\n"); - dhexdumpat(li->LoadOptions, li->LoadOptionsSize, 0); + if (!li->LoadOptions || !li->LoadOptionsSize) { + dprint(L"LoadOptions is empty\n"); + return EFI_SUCCESS; + } else { + dprint(L"full LoadOptions:\n"); + dhexdumpat(li->LoadOptions, li->LoadOptionsSize, 0); + } /* * Sanity check since we make several assumptions about the length -- cgit v1.2.3