From aecfbc81a98871967595164d431e8ba8adacb601 Mon Sep 17 00:00:00 2001 From: Sergei Dmitrouk Date: Wed, 19 May 2021 00:09:40 +0800 Subject: 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 Cc: Zhichao Gao Signed-off-by: Sergei Dmitrouk Reviewed-by: Liming Gao --- ShellPkg/DynamicCommand/HttpDynamicCommand/Http.c | 1 + 1 file changed, 1 insertion(+) (limited to 'ShellPkg') 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; -- cgit v1.2.3