[edk2-devel] [PATCH v1 1/2] MdeModulePkg: BdsDxe: Uninitialized local variable.

Paul via groups.io posted 2 patches 3 years, 3 months ago
[edk2-devel] [PATCH v1 1/2] MdeModulePkg: BdsDxe: Uninitialized local variable.
Posted by Paul via groups.io 3 years, 3 months ago
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



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#95485): https://edk2.groups.io/g/devel/message/95485
Mute This Topic: https://groups.io/mt/94499485/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-