[edk2] [Patch] MdeModulePkg HiiDataBaseDxe: Initialize the local variable before reference

Liming Gao posted 1 patch 6 years, 10 months ago
Failed in applying to current master (apply log)
MdeModulePkg/Universal/HiiDatabaseDxe/Database.c | 3 +++
1 file changed, 3 insertions(+)
[edk2] [Patch] MdeModulePkg HiiDataBaseDxe: Initialize the local variable before reference
Posted by Liming Gao 6 years, 10 months ago
Make VS2012x86 and GCC48 pass build

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
---
 MdeModulePkg/Universal/HiiDatabaseDxe/Database.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c b/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
index ffcd9ec..7441c19 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
@@ -739,6 +739,8 @@ FindQuestionDefaultSetting (
   if (VariableHeader == NULL) {
     return EFI_NOT_FOUND;
   }
+  StartBit   = 0;
+  EndBit     = 0;
   ByteOffset = IfrQuestionHdr->VarStoreInfo.VarOffset;
   if (BitFieldQuestion) {
     BitOffset  = IfrQuestionHdr->VarStoreInfo.VarOffset;
@@ -818,6 +820,7 @@ UpdateDefaultSettingInFormPackage (
 
   ZeroMem (&VarStoreQuestionHeader, sizeof (VarStoreQuestionHeader));
   PackageLength = FormPackage->FormPkgHdr.Length - sizeof (EFI_HII_PACKAGE_HEADER);
+  Width         = 0;
   IfrOffset     = 0;
   IfrScope      = 0;
   IfrOpHdr      = (EFI_IFR_OP_HEADER *) FormPackage->IfrData;
-- 
2.8.0.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [Patch] MdeModulePkg HiiDataBaseDxe: Initialize the local variable before reference
Posted by Dong, Eric 6 years, 10 months ago
Reviewed-by: Eric Dong <eric.dong@intel.com>

-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Liming Gao
Sent: Monday, December 25, 2017 6:25 PM
To: edk2-devel@lists.01.org
Subject: [edk2] [Patch] MdeModulePkg HiiDataBaseDxe: Initialize the local variable before reference

Make VS2012x86 and GCC48 pass build

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
---
 MdeModulePkg/Universal/HiiDatabaseDxe/Database.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c b/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
index ffcd9ec..7441c19 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
@@ -739,6 +739,8 @@ FindQuestionDefaultSetting (
   if (VariableHeader == NULL) {
     return EFI_NOT_FOUND;
   }
+  StartBit   = 0;
+  EndBit     = 0;
   ByteOffset = IfrQuestionHdr->VarStoreInfo.VarOffset;
   if (BitFieldQuestion) {
     BitOffset  = IfrQuestionHdr->VarStoreInfo.VarOffset;
@@ -818,6 +820,7 @@ UpdateDefaultSettingInFormPackage (
 
   ZeroMem (&VarStoreQuestionHeader, sizeof (VarStoreQuestionHeader));
   PackageLength = FormPackage->FormPkgHdr.Length - sizeof (EFI_HII_PACKAGE_HEADER);
+  Width         = 0;
   IfrOffset     = 0;
   IfrScope      = 0;
   IfrOpHdr      = (EFI_IFR_OP_HEADER *) FormPackage->IfrData;
-- 
2.8.0.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel