diff options
author | Shenglei Zhang <shenglei.zhang@intel.com> | 2019-10-15 10:56:05 +0800 |
---|---|---|
committer | Liming Gao <liming.gao@intel.com> | 2019-11-06 13:26:21 +0800 |
commit | 3fb7e094efc87c46fffb2d755183bbe70da09396 (patch) | |
tree | d3ca6090eb94ce19d70c54cfd8549cbd8ec2c323 /MdeModulePkg/Universal/EsrtDxe | |
parent | e34022dcbe64996d0fc8be0b1b8e09ae7134216c (diff) | |
download | edk2-3fb7e094efc87c46fffb2d755183bbe70da09396.tar.gz edk2-3fb7e094efc87c46fffb2d755183bbe70da09396.tar.bz2 edk2-3fb7e094efc87c46fffb2d755183bbe70da09396.zip |
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/EsrtDxe')
-rw-r--r-- | MdeModulePkg/Universal/EsrtDxe/EsrtImpl.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/MdeModulePkg/Universal/EsrtDxe/EsrtImpl.c b/MdeModulePkg/Universal/EsrtDxe/EsrtImpl.c index f48125382d..fff17b98fa 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
|