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

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

Cc: Zhiguang Liu <zhiguang....@intel.com>
Cc: Ray Ni <ray...@intel.com>
Cc: Gua Guo <gua....@intel.com>
Signed-off-by: Paul Grimes <paul.gri...@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/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to