summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal
diff options
context:
space:
mode:
authorShenglei Zhang <shenglei.zhang@intel.com>2019-10-15 10:56:05 +0800
committerLiming Gao <liming.gao@intel.com>2019-11-06 13:26:21 +0800
commit3fb7e094efc87c46fffb2d755183bbe70da09396 (patch)
treed3ca6090eb94ce19d70c54cfd8549cbd8ec2c323 /MdeModulePkg/Universal
parente34022dcbe64996d0fc8be0b1b8e09ae7134216c (diff)
downloadedk2-3fb7e094efc87c46fffb2d755183bbe70da09396.zip
edk2-3fb7e094efc87c46fffb2d755183bbe70da09396.tar.gz
edk2-3fb7e094efc87c46fffb2d755183bbe70da09396.tar.bz2
MdeModulePkg/EsrtDxe: Add check for EsrtRepository
EsrtRepository might be NULL. So return EFI_OUT_OF_RESOURCES when it is NULL. Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Diffstat (limited to 'MdeModulePkg/Universal')
-rw-r--r--MdeModulePkg/Universal/EsrtDxe/EsrtImpl.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/MdeModulePkg/Universal/EsrtDxe/EsrtImpl.c b/MdeModulePkg/Universal/EsrtDxe/EsrtImpl.c
index f481253..fff17b9 100644
--- a/MdeModulePkg/Universal/EsrtDxe/EsrtImpl.c
+++ b/MdeModulePkg/Universal/EsrtDxe/EsrtImpl.c
@@ -239,6 +239,11 @@ DeleteEsrtEntry(
goto EXIT;
}
+ if (EsrtRepository == NULL) {
+ Status = EFI_OUT_OF_RESOURCES;
+ goto EXIT;
+ }
+
if ((RepositorySize % sizeof(EFI_SYSTEM_RESOURCE_ENTRY)) != 0) {
DEBUG((EFI_D_ERROR, "Repository Corrupt. Need to rebuild Repository.\n"));
//
@@ -332,6 +337,11 @@ UpdateEsrtEntry(
&RepositorySize
);
+ if (EsrtRepository == NULL) {
+ Status = EFI_OUT_OF_RESOURCES;
+ goto EXIT;
+ }
+
if (!EFI_ERROR(Status)) {
//
// if exist, update Esrt cache repository