]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
env: efi: fix a wrong address dereference
authorAKASHI Takahiro <takahiro.akashi@linaro.org>
Sat, 3 Jul 2021 06:43:17 +0000 (15:43 +0900)
committerTom Rini <trini@konsulko.com>
Mon, 5 Jul 2021 19:28:32 +0000 (15:28 -0400)
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'")
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
[trini: Don't make guid const now]
Signed-off-by: Tom Rini <trini@konsulko.com>
cmd/nvedit_efi.c

index 094c0e809870599d0c519eb9b26e7a89f6827683..d5e93827e45c98fbe9b28643c7fa3c0d87bff899 100644 (file)
@@ -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--;