mirror of https://github.com/acidanthera/audk.git
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>
This commit is contained in:
parent
e34022dcbe
commit
3fb7e094ef
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue