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.web12.309.1621354193876726220 for ; Tue, 18 May 2021 09:09:54 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@posteo.net header.s=2017 header.b=cbK2HZbI; 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 43A852400FC for ; Tue, 18 May 2021 18:09:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1621354192; bh=w/xZRHI8AYCx9EZ8M90uekHThQN2IxIQeMgxUbwlx3g=; h=From:To:Cc:Subject:Date:From; b=cbK2HZbI2LQhswvNFDyL18h7lgRTBJN0tKlRecf+LvYCr4UdhrhCoy65NBbmiyMTp 3gVQVE5H6HpIAAXaIkS4AxQNnkSezwdrQj2tLIvKAQKBbwxPtulxiLIHboWla/plRM ApJvNjIHXIo0lmp/PGgpUBBP/jVYcOqs7gcNUvKxeMHuFzfBMBehnfOs2r53JIEXkv yWPBVI42VqiDk52fZ5QHy16oPN/s8Qg7/EYrMajWUNnrx11FShQnzdg6JFohCp7wsK hGoI7oeJIHShI1cKX/AsBNP9ENXW3Vy9WNXW3yD+wZ+e9qdFvbCmP8mUmtROZEqzd0 +ZGwGMhuM792Q== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Fl1DH3x2cz9rxG; Tue, 18 May 2021 18:09:51 +0200 (CEST) From: "Sergei Dmitrouk" To: devel@edk2.groups.io Cc: Ray Ni , Zhichao Gao Subject: [PATCH v2 1/3] ShellPkg/HttpDynamicCommand: Fix possible uninitialized use Date: Tue, 18 May 2021 16:09:40 +0000 Message-Id: <20210518160942.17634-2-sergei@posteo.net> In-Reply-To: <20210518160942.17634-1-sergei@posteo.net> References: <20210518160942.17634-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