From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.66]) by mx.groups.io with SMTP id smtpd.web11.7867.1620994651919904010 for ; Fri, 14 May 2021 05:17:32 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@posteo.net header.s=2017 header.b=ewC9PnBb; spf=pass (domain: posteo.net, ip: 185.67.36.66, mailfrom: sergei@posteo.net) Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 037D62400FD for ; Fri, 14 May 2021 14:17:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1620994649; bh=w/xZRHI8AYCx9EZ8M90uekHThQN2IxIQeMgxUbwlx3g=; h=From:To:Cc:Subject:Date:From; b=ewC9PnBb2leAfRr5X0YT5HfvlcbW+HRwTY1MKtUTRyZM7u+jpJLA6B9RythOPPNMs NIeJHlQS8h3IlxADMhtOVj9XRIw2PVkJGK9uq0xH5NF3oqgucFKSbCrtVqYxcj71UP 07Dy0aQzUgAGMtuYjKEi/J7pqa1frilaXKkoct4Vli1QpAQe5lJ69TP5svq9sgqcFB 9k8USjfZuXQHOY9UNDY25dAAQBkvf2Xxv3QrrVb5oZRo71Lv0aOnucFrVknyBcTBj+ k4ZTx4QIUwO3v4DBEMuiVhTjbQmC7vEa4iRuh02q0hbedcvgREseza18JHbKOX4y8J 4m2oMbPPtTJ5g== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4FhSG02JNRz9rxR; Fri, 14 May 2021 14:17:28 +0200 (CEST) From: "Sergei Dmitrouk" To: devel@edk2.groups.io Cc: Ray Ni , Zhichao Gao Subject: [PATCH v1 1/3] ShellPkg/HttpDynamicCommand: Fix possible uninitialized use Date: Fri, 14 May 2021 12:17:12 +0000 Message-Id: <20210514121714.17312-2-sergei@posteo.net> In-Reply-To: <20210514121714.17312-1-sergei@posteo.net> References: <20210514121714.17312-1-sergei@posteo.net> `Status` can be used uninitialized: /* Evaluates to FALSE */ if (ShellGetExecutionBreakFlag ()) { Status = EFI_ABORTED; break; } /* Evaluates to FALSE */ if (!Context->ContentDownloaded && !Context->ResponseToken.Event) { Status = ...; ASSERT_EFI_ERROR (Status); } else { ResponseMessage.Data.Response = NULL; } /* UNINITIALIZED USE */ if (EFI_ERROR (Status)) { break; } Cc: Ray Ni Cc: Zhichao Gao Signed-off-by: Sergei Dmitrouk --- ShellPkg/DynamicCommand/HttpDynamicCommand/Http.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ShellPkg/DynamicCommand/HttpDynamicCommand/Http.c b/ShellPkg/DynamicCommand/HttpDynamicCommand/Http.c index 3735a4a7e645..7b9b2d238015 100644 --- a/ShellPkg/DynamicCommand/HttpDynamicCommand/Http.c +++ b/ShellPkg/DynamicCommand/HttpDynamicCommand/Http.c @@ -1524,6 +1524,7 @@ GetResponse ( Context->ResponseToken.Message = &ResponseMessage; Context->ContentLength = 0; Context->Status = REQ_OK; + Status = EFI_SUCCESS; MsgParser = NULL; ResponseData.StatusCode = HTTP_STATUS_UNSUPPORTED_STATUS; ResponseMessage.Data.Response = &ResponseData; -- 2.17.6