summaryrefslogtreecommitdiffstats
path: root/ShellPkg
diff options
context:
space:
mode:
authorSergei Dmitrouk <sergei@posteo.net>2021-05-19 00:09:40 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-05-19 01:39:49 +0000
commitaecfbc81a98871967595164d431e8ba8adacb601 (patch)
tree6e733f59e6f6b2addb8dca5abdc3dd7591512ebd /ShellPkg
parent42ec0a315b8a2f445b7a7d74b8d78965f1dff8f6 (diff)
downloadedk2-aecfbc81a98871967595164d431e8ba8adacb601.tar.gz
edk2-aecfbc81a98871967595164d431e8ba8adacb601.tar.bz2
edk2-aecfbc81a98871967595164d431e8ba8adacb601.zip
ShellPkg/HttpDynamicCommand: Fix possible uninitialized use
`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 <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Sergei Dmitrouk <sergei@posteo.net> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Diffstat (limited to 'ShellPkg')
-rw-r--r--ShellPkg/DynamicCommand/HttpDynamicCommand/Http.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/ShellPkg/DynamicCommand/HttpDynamicCommand/Http.c b/ShellPkg/DynamicCommand/HttpDynamicCommand/Http.c
index 3735a4a7e6..7b9b2d2380 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;