summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorStar Zeng <star.zeng@intel.com>2014-08-20 07:05:55 +0000
committerlzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524>2014-08-20 07:05:55 +0000
commit0a13a624136bf2b278851316d8eae23611d93ad2 (patch)
tree6e1bae2c9cf5f7327c012edcc2a00110344ba135 /MdeModulePkg
parentf95e6f6b00f800e7f36cc761d9048735d595f21e (diff)
downloadedk2-platforms-0a13a624136bf2b278851316d8eae23611d93ad2.tar.xz
MdeModulePkg PeiCore: Add NULL pointer check.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15846 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Core/Pei/PeiMain/PeiMain.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c b/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c
index d105fce28d..3220ffb8ee 100644
--- a/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c
+++ b/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c
@@ -313,17 +313,25 @@ PeiCore (
// Initialize PEI Core Private Data Buffer
//
PrivateData.PpiData.PpiListPtrs = AllocateZeroPool (sizeof (PEI_PPI_LIST_POINTERS) * PcdGet32 (PcdPeiCoreMaxPpiSupported));
+ ASSERT (PrivateData.PpiData.PpiListPtrs != NULL);
PrivateData.Fv = AllocateZeroPool (sizeof (PEI_CORE_FV_HANDLE) * PcdGet32 (PcdPeiCoreMaxFvSupported));
+ ASSERT (PrivateData.Fv != NULL);
PrivateData.Fv[0].PeimState = AllocateZeroPool (sizeof (UINT8) * PcdGet32 (PcdPeiCoreMaxPeimPerFv) * PcdGet32 (PcdPeiCoreMaxFvSupported));
+ ASSERT (PrivateData.Fv[0].PeimState != NULL);
PrivateData.Fv[0].FvFileHandles = AllocateZeroPool (sizeof (EFI_PEI_FILE_HANDLE) * PcdGet32 (PcdPeiCoreMaxPeimPerFv) * PcdGet32 (PcdPeiCoreMaxFvSupported));
+ ASSERT (PrivateData.Fv[0].FvFileHandles != NULL);
for (Index = 1; Index < PcdGet32 (PcdPeiCoreMaxFvSupported); Index ++) {
PrivateData.Fv[Index].PeimState = PrivateData.Fv[Index - 1].PeimState + PcdGet32 (PcdPeiCoreMaxPeimPerFv);
PrivateData.Fv[Index].FvFileHandles = PrivateData.Fv[Index - 1].FvFileHandles + PcdGet32 (PcdPeiCoreMaxPeimPerFv);
}
PrivateData.UnknownFvInfo = AllocateZeroPool (sizeof (PEI_CORE_UNKNOW_FORMAT_FV_INFO) * PcdGet32 (PcdPeiCoreMaxFvSupported));
+ ASSERT (PrivateData.UnknownFvInfo != NULL);
PrivateData.CurrentFvFileHandles = AllocateZeroPool (sizeof (EFI_PEI_FILE_HANDLE) * PcdGet32 (PcdPeiCoreMaxPeimPerFv));
+ ASSERT (PrivateData.CurrentFvFileHandles != NULL);
PrivateData.FileGuid = AllocatePool (sizeof (EFI_GUID) * PcdGet32 (PcdPeiCoreMaxPeimPerFv));
+ ASSERT (PrivateData.FileGuid != NULL);
PrivateData.FileHandles = AllocatePool (sizeof (EFI_PEI_FILE_HANDLE) * (PcdGet32 (PcdPeiCoreMaxPeimPerFv) + 1));
+ ASSERT (PrivateData.FileHandles != NULL);
}
InitializePpiServices (&PrivateData, OldCoreData);