public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Sergei Dmitrouk" <sergei@posteo.net>
To: devel@edk2.groups.io
Cc: Ray Ni <ray.ni@intel.com>, Zhichao Gao <zhichao.gao@intel.com>
Subject: [PATCH v1 1/3] ShellPkg/HttpDynamicCommand: Fix possible uninitialized use
Date: Fri, 14 May 2021 12:17:12 +0000	[thread overview]
Message-ID: <20210514121714.17312-2-sergei@posteo.net> (raw)
In-Reply-To: <20210514121714.17312-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 <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Signed-off-by: Sergei Dmitrouk <sergei@posteo.net>
---
 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


  reply	other threads:[~2021-05-14 12:17 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-14 12:17 [PATCH v1 0/3] Fix possible uninitialized uses Sergei Dmitrouk
2021-05-14 12:17 ` Sergei Dmitrouk [this message]
2021-05-14 12:17 ` [PATCH v1 2/3] MdeModulePkg/PciBusDxe: Fix possible uninitialized use Sergei Dmitrouk
2021-05-17  2:05   ` Ni, Ray
2021-05-17 16:22     ` [edk2-devel] " Sergei Dmitrouk
2021-05-18  8:01       ` Wu, Hao A
2021-05-14 12:17 ` [PATCH v1 3/3] CryptoPkg/BaseCryptLib: " Sergei Dmitrouk
2021-05-15  0:30   ` Yao, Jiewen
2021-05-15 13:00     ` [edk2-devel] " Sergei Dmitrouk
2021-05-18  0:59       ` 回复: " gaoliming
2021-05-18  7:26         ` Ard Biesheuvel
2021-05-18  7:36           ` Wang, Jian J
2021-05-19  0:59             ` 回复: " gaoliming
2021-05-19  1:03               ` Yao, Jiewen
2021-05-18 16:02         ` 回复: " Sergei Dmitrouk
2021-05-19  1:26           ` 回复: " gaoliming

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210514121714.17312-2-sergei@posteo.net \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox