From 3fb0a874b5030c289d809c3b8f8a96da7846b3f9 Mon Sep 17 00:00:00 2001 From: Jurij Ivastsuk-Kienbaum Date: Sat, 30 Dec 2023 17:42:49 +0100 Subject: [PATCH 1/2] Improving the robustness of value retention for the variable second_stage --- load-options.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/load-options.c b/load-options.c index a8c6e1a3d..c2289ed53 100644 --- a/load-options.c +++ b/load-options.c @@ -449,7 +449,7 @@ parse_load_options(EFI_LOADED_IMAGE *li) * Set up the name of the alternative loader and the LoadOptions for * the loader */ - if (loader_str) { + if (loader_str && isprint(loader_str[0])) { second_stage = loader_str; load_options = remaining; load_options_size = remaining_size; From 71162ba93e36370348ac52b25d7bef668ea78113 Mon Sep 17 00:00:00 2001 From: Jurij Ivastsuk-Kienbaum Date: Sat, 30 Dec 2023 17:52:46 +0100 Subject: [PATCH 2/2] Improving the robustness of value retention for the variable second_stage --- load-options.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/load-options.c b/load-options.c index c2289ed53..013990eb5 100644 --- a/load-options.c +++ b/load-options.c @@ -447,7 +447,9 @@ parse_load_options(EFI_LOADED_IMAGE *li) /* * Set up the name of the alternative loader and the LoadOptions for - * the loader + * the loader. But before that check the first char of loader_str + * for non printable character. If this is a case do not set up + * alternative loader */ if (loader_str && isprint(loader_str[0])) { second_stage = loader_str;