Skip to contentSkip to conversation

env: efi: fix a wrong address dereference

PATCH In review Tom Rini 1 participant 2 messages Jul 3, 2021 – Jul 6, 2021

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/1 env: efi: fix a wrong address dereference

From: AKASHI Takahiro <[email protected]>

Probably, a pointer to a variable in an inner block should not be exposed to an outer block.

Fixes c70f44817d46 ("efi_loader: simplify 'printenv -e'")
[trini: Don't make guid const now]
---
 cmd/nvedit_efi.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
cmd/nvedit_efi.c +1 -2
index 094c0e809870..d5e93827e45c 100644
@@ -241,6 +241,7 @@ int do_env_print_efi(struct cmd_tbl *cmdtp, int flag, int argc,
 		     char *const argv[])
 {
 	const efi_guid_t *guid_p = NULL;
+	efi_guid_t guid;
 	bool verbose = true;
 	efi_status_t ret;
 
@@ -254,8 +255,6 @@ int do_env_print_efi(struct cmd_tbl *cmdtp, int flag, int argc,
 
 	for (argc--, argv++; argc > 0 && argv[0][0] == '-'; argc--, argv++) {
 		if (!strcmp(argv[0], "-guid")) {
-			efi_guid_t guid;
-
 			if (argc == 1)
 				return CMD_RET_USAGE;
 			argc--;
Signature · 1 line
2.17.1