public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Paul" <paul.grimes@amd.com>
To: <devel@edk2.groups.io>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>, Ray Ni <ray.ni@intel.com>,
	Gua Guo <gua.guo@intel.com>
Subject: [PATCH v1 1/2] MdeModulePkg: BdsDxe: Uninitialized local variable.
Date: Sat, 22 Oct 2022 09:00:09 -0700	[thread overview]
Message-ID: <20221022160010.632-2-paul.grimes@amd.com> (raw)
In-Reply-To: <20221022160010.632-1-paul.grimes@amd.com>

From: Paul Grimes <paul.grimes@amd.com>

In function BdsFormalizeConsoleVariable(), VariableSize is used
prior to being initialized.  This change initializes the variable.

Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Gua Guo <gua.guo@intel.com>
Signed-off-by: Paul Grimes <paul.grimes@amd.com>
---
 MdeModulePkg/Universal/BdsDxe/BdsEntry.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
index 766dde3aaeeb..455fc344f0be 100644
--- a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
+++ b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
@@ -518,6 +518,8 @@ BdsFormalizeConsoleVariable (
   UINTN                     VariableSize;
   EFI_STATUS                Status;
 
+  VariableSize = 0;
+
   GetEfiGlobalVariable2 (VariableName, (VOID **)&DevicePath, &VariableSize);
   if ((DevicePath != NULL) && !IsDevicePathValid (DevicePath, VariableSize)) {
     Status = gRT->SetVariable (
-- 
2.24.0.windows.2


  reply	other threads:[~2022-10-22 16:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-22 16:00 [PATCH v1 0/2] Uninitialized local variable Paul
2022-10-22 16:00 ` Paul [this message]
2022-10-22 16:00 ` [PATCH v1 2/2] SecurityPkg: OpalPasswordDxe: uninitialized " Paul
2022-10-26 13:45   ` [edk2-devel] " Yao, Jiewen
2022-10-26  1:17 ` 回复: [edk2-devel] [PATCH v1 0/2] Uninitialized " 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=20221022160010.632-2-paul.grimes@amd.com \
    --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