]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools/VfrCompile: Initialize local variables before being used
authorHao Wu <hao.a.wu@intel.com>
Tue, 11 Oct 2016 02:56:20 +0000 (10:56 +0800)
committerHao Wu <hao.a.wu@intel.com>
Tue, 8 Nov 2016 08:36:43 +0000 (16:36 +0800)
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp
BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp

index aa27ce0be72e0682bbda0e9183eaa7bfb3969079..124b8e8e726d6b585fe82dfbab15eca3488e751c 100644 (file)
@@ -825,7 +825,7 @@ CFormPkg::DeclarePendingQuestion (
   CHAR8          FName[MAX_NAME_LEN];\r
   CHAR8          *SName;\r
   CHAR8          *NewStr;\r
-  UINT32         ShrinkSize;\r
+  UINT32         ShrinkSize = 0;\r
   EFI_VFR_RETURN_CODE  ReturnCode;\r
   EFI_VFR_VARSTORE_TYPE VarStoreType  = EFI_VFR_VARSTORE_INVALID;\r
   EFI_VARSTORE_ID       VarStoreId    = EFI_VARSTORE_ID_INVALID;\r
@@ -1297,6 +1297,7 @@ CIfrRecordInfoDB::IfrAdjustDynamicOpcodeInRecords (
   SIfrRecord         *pAdjustNode, *pNodeBeforeAdjust;\r
   SIfrRecord         *pNodeBeforeDynamic;\r
 \r
+  pPreNode            = NULL;\r
   pAdjustNode         = NULL;\r
   pNodeBeforeDynamic  = NULL;\r
   OpcodeOffset        = 0;\r
@@ -1845,6 +1846,7 @@ CIfrRecordInfoDB::IfrCreateDefaultForQuestion (
     // Point to the first expression opcode.\r
     //\r
     pSNode = pDefaultNode->mNext;\r
+    pENode = NULL;\r
     ScopeCount++;\r
     //\r
     // Get opcode number behind the EFI_IFR_DEFAULT_2 until reach its END opcode (including the END opcode of EFI_IFR_DEFAULT_2)\r
index d2cb5cc9ded702813f9b086cd0a398a9e813b066..1ab95bec0acbeae3e24f7f808daaec3fcaa40126 100644 (file)
@@ -1328,7 +1328,7 @@ SVfrVarStorageNode::SVfrVarStorageNode (
   if (Guid != NULL) {\r
     mGuid = *Guid;\r
   } else {\r
-    memset (&Guid, 0, sizeof (EFI_GUID));\r
+    memset (&mGuid, 0, sizeof (EFI_GUID));\r
   }\r
   if (StoreName != NULL) {\r
     mVarStoreName = new CHAR8[strlen(StoreName) + 1];\r
@@ -1355,7 +1355,7 @@ SVfrVarStorageNode::SVfrVarStorageNode (
   if (Guid != NULL) {\r
     mGuid = *Guid;\r
   } else {\r
-    memset (&Guid, 0, sizeof (EFI_GUID));\r
+    memset (&mGuid, 0, sizeof (EFI_GUID));\r
   }\r
   if (StoreName != NULL) {\r
     mVarStoreName = new CHAR8[strlen(StoreName) + 1];\r