Skip to content

Commit

Permalink
ShellPkg/HttpDynamicCommand: Fix possible uninitialized use
Browse files Browse the repository at this point in the history
`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 <[email protected]>
Cc: Zhichao Gao <[email protected]>
Signed-off-by: Sergei Dmitrouk <[email protected]>
Reviewed-by: Liming Gao <[email protected]>
  • Loading branch information
Sergei Dmitrouk authored and mergify[bot] committed May 19, 2021
1 parent 42ec0a3 commit aecfbc8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ShellPkg/DynamicCommand/HttpDynamicCommand/Http.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit aecfbc8

Please sign in to comment.