EsrtRepository might be NULL. So return EFI_OUT_OF_RESOURCES when it is NULL.
Cc: Hao A Wu <hao.a...@intel.com> Cc: Liming Gao <liming....@intel.com> Signed-off-by: Shenglei Zhang <shenglei.zh...@intel.com> --- MdeModulePkg/Universal/EsrtDxe/EsrtImpl.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/MdeModulePkg/Universal/EsrtDxe/EsrtImpl.c b/MdeModulePkg/Universal/EsrtDxe/EsrtImpl.c index f48125382dbc..fff17b98fa3d 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 -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#49147): https://edk2.groups.io/g/devel/message/49147 Mute This Topic: https://groups.io/mt/34668866/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-