Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9857DC07E97 for ; Sat, 3 Jul 2021 14:25:34 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CDC9F6144A for ; Sat, 3 Jul 2021 14:25:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CDC9F6144A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5789880C68; Sat, 3 Jul 2021 16:25:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 780D582903; Sat, 3 Jul 2021 16:25:30 +0200 (CEST) Received: from mail-qv1-f42.google.com (mail-qv1-f42.google.com [209.85.219.42]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id DA7DD80796 for ; Sat, 3 Jul 2021 16:25:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=tom.rini@gmail.com Received: by mail-qv1-f42.google.com with SMTP id g14so6175286qvo.7 for ; Sat, 03 Jul 2021 07:25:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Q4GqGq61QGmhvZsUmphG4MQ68zbarBKdKj3PALeCB+g=; b=KW8g9NX4WE5TZzHiuXqODS6M/Evgs612C9fMiIh8CT6vLE0iuOjgcL5M0Mmcl1n3l+ QT2ttnnbRn6Z3hWrwnQHLmUJEuI+eI8hnHncOJBBLSG6DO/K+KzxUU/rCBPcnH5IKLkw V/NNaT0AenxblsmO8mFTkZ9kcNATNCwErlgKx36ImgKthZFSP1zS91qs5kbArnIn9K1c eCQQPEMeIT1MPsBSONSKfIgMCo2Sslup/16fFTluKCNWUjuwe5BilMnAx7ztPGICkgcg eP5dnRS4smV3mPdjGn+f+2FCj5XU4ZDDFXlIdVhLWfVh2jyV0lLXUoLvUwLlmIKQC9nN ahmg== X-Gm-Message-State: AOAM532rrP82hmXsWycnq9BmNljBaxygX0jGbsFyJXzNOeVjhKszn7/v CAkBt5rwl5y4MUJiwHczJyMxgwZhZFd7 X-Google-Smtp-Source: ABdhPJzljJeay3oiCnf0vnv8Esgmxxn/C3XvfKXLitLDwEhUUpfRFofyDdzYHlQBCfll1pRQyZzAnA== X-Received: by 2002:a0c:ba05:: with SMTP id w5mr5057221qvf.60.1625322326177; Sat, 03 Jul 2021 07:25:26 -0700 (PDT) Received: from bill-the-cat.lan (2603-6081-7b01-cbda-447a-194c-2139-e81a.res6.spectrum.com. [2603:6081:7b01:cbda:447a:194c:2139:e81a]) by smtp.gmail.com with ESMTPSA id j12sm2346124qtn.19.2021.07.03.07.25.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Jul 2021 07:25:25 -0700 (PDT) From: Tom Rini To: u-boot@lists.denx.de Cc: AKASHI Takahiro Subject: [PATCH] env: efi: fix a wrong address dereference Date: Sat, 3 Jul 2021 10:25:22 -0400 Message-Id: <20210703142522.31364-1-trini@konsulko.com> X-Mailer: git-send-email 2.17.1 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean From: AKASHI Takahiro 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 [trini: Don't make guid const now] Signed-off-by: Tom Rini --- cmd/nvedit_efi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cmd/nvedit_efi.c b/cmd/nvedit_efi.c index 094c0e809870..d5e93827e45c 100644 --- a/cmd/nvedit_efi.c +++ b/cmd/nvedit_efi.c @@ -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--; -- 2.17.1