From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E1C171A1ECD for ; Wed, 12 Oct 2016 05:21:21 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP; 12 Oct 2016 05:21:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,482,1473145200"; d="scan'208";a="1063788648" Received: from shwdeopenpsi014.ccr.corp.intel.com ([10.239.9.34]) by orsmga002.jf.intel.com with ESMTP; 12 Oct 2016 05:21:20 -0700 From: Hao Wu To: edk2-devel@lists.01.org Cc: Hao Wu , Liming Gao , Yonghong Zhu , Eric Dong , Dandan Bi Date: Wed, 12 Oct 2016 20:19:57 +0800 Message-Id: <1476274836-10544-14-git-send-email-hao.a.wu@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.0 In-Reply-To: <1476274836-10544-1-git-send-email-hao.a.wu@intel.com> References: <1476274836-10544-1-git-send-email-hao.a.wu@intel.com> Subject: [PATCH 13/52] BaseTools/VfrCompile: Initialize local variables before being used X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 12:21:22 -0000 Cc: Liming Gao Cc: Yonghong Zhu Cc: Eric Dong Cc: Dandan Bi Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu --- BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp | 4 +++- BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp b/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp index aa27ce0..124b8e8 100644 --- a/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp +++ b/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp @@ -825,7 +825,7 @@ CFormPkg::DeclarePendingQuestion ( CHAR8 FName[MAX_NAME_LEN]; CHAR8 *SName; CHAR8 *NewStr; - UINT32 ShrinkSize; + UINT32 ShrinkSize = 0; EFI_VFR_RETURN_CODE ReturnCode; EFI_VFR_VARSTORE_TYPE VarStoreType = EFI_VFR_VARSTORE_INVALID; EFI_VARSTORE_ID VarStoreId = EFI_VARSTORE_ID_INVALID; @@ -1297,6 +1297,7 @@ CIfrRecordInfoDB::IfrAdjustDynamicOpcodeInRecords ( SIfrRecord *pAdjustNode, *pNodeBeforeAdjust; SIfrRecord *pNodeBeforeDynamic; + pPreNode = NULL; pAdjustNode = NULL; pNodeBeforeDynamic = NULL; OpcodeOffset = 0; @@ -1845,6 +1846,7 @@ CIfrRecordInfoDB::IfrCreateDefaultForQuestion ( // Point to the first expression opcode. // pSNode = pDefaultNode->mNext; + pENode = NULL; ScopeCount++; // // Get opcode number behind the EFI_IFR_DEFAULT_2 until reach its END opcode (including the END opcode of EFI_IFR_DEFAULT_2) diff --git a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp b/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp index d2cb5cc..1ab95be 100644 --- a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp +++ b/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp @@ -1328,7 +1328,7 @@ SVfrVarStorageNode::SVfrVarStorageNode ( if (Guid != NULL) { mGuid = *Guid; } else { - memset (&Guid, 0, sizeof (EFI_GUID)); + memset (&mGuid, 0, sizeof (EFI_GUID)); } if (StoreName != NULL) { mVarStoreName = new CHAR8[strlen(StoreName) + 1]; @@ -1355,7 +1355,7 @@ SVfrVarStorageNode::SVfrVarStorageNode ( if (Guid != NULL) { mGuid = *Guid; } else { - memset (&Guid, 0, sizeof (EFI_GUID)); + memset (&mGuid, 0, sizeof (EFI_GUID)); } if (StoreName != NULL) { mVarStoreName = new CHAR8[strlen(StoreName) + 1]; -- 1.9.5.msysgit.0