From patchwork Sat Jul 3 14:25:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Rini X-Patchwork-Id: 469870 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp2370769jao; Sat, 3 Jul 2021 07:25:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyqpGUuxDfN0r/KVRfdUeuz7FE5qjykKOX0efA2XvWVaFDnGJPMgy32GuVFuTYWFMQemGQh X-Received: by 2002:a17:907:3d88:: with SMTP id he8mr5037304ejc.296.1625322334713; Sat, 03 Jul 2021 07:25:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625322334; cv=none; d=google.com; s=arc-20160816; b=avsRWaRAfyyvxTG9XqbCCkQ6lWGKBDXrU6Np3YRzwxVI3p2/Avgs8LmYoQvDexAHyF 7H10wypZXwuxx1TdXn63cIZpKjNSIEiT+/QfN+Cr4eCZyQAPSym2fCnPqvRpVRWccJWr iQUqgy+kuJNSn1YHPJdZzMCxyZcfF8SBWmX3CDAp6w0fPP9QSr+U9XVgD8/LHQwGhbRR gm1rSb5hNCO/uYBsaev7BmyP471mndvp+Llw93Sm1nK+83UC8ljpvPBLdyU9EsUb3WR9 Jo5kvNc3NwG10EcL40/O5hjyGdmuTcXW0EIcOTtI5tGV5czhTX3zGXozIf0sz963g3jZ BPTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=Q4GqGq61QGmhvZsUmphG4MQ68zbarBKdKj3PALeCB+g=; b=b6vUk1Nx+AgXg2xy7zHyBDkK/xu5+TWmAoRZkXQIetyJdXB+b88LBKP/qB2VQ7JbJz pb4WxgEf/nyXIT3zo9bMLW1nH0YN3ZG2FlVCHIKkfxg0GTGiwEFJ5oLHBkqp8z5HWthS 9IvGddl42axYjUVbK0ftseFadlHEcNXPPQa90m/slyoQqUHk1ne73ybCUAqCYk+nMbbZ vIbP1NRZ8LElMr1RzUEIMfpxVjAuU6UdvaFNElGf+UhN4qXot3QylIkipeWp/iSM6kiR np7s72+UDxho2twLLcOa9y/LiCWU4dI8B9BJjI0X6y7g+PJh7bKSxQDRkfrmSSEHBmWr BKFA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id o4si6241469eje.262.2021.07.03.07.25.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Jul 2021 07:25:34 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) 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) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 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-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(-) -- 2.17.1 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--;