]> git.proxmox.com Git - mirror_edk2.git/commit
ShellPkg/HttpDynamicCommand: Fix possible uninitialized use
authorSergei Dmitrouk <sergei@posteo.net>
Tue, 18 May 2021 16:09:40 +0000 (00:09 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 19 May 2021 01:39:49 +0000 (01:39 +0000)
commitaecfbc81a98871967595164d431e8ba8adacb601
tree6e733f59e6f6b2addb8dca5abdc3dd7591512ebd
parent42ec0a315b8a2f445b7a7d74b8d78965f1dff8f6
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>
ShellPkg/DynamicCommand/HttpDynamicCommand/Http.c