From: Jayanth Raghuram Date: Thu, 29 Aug 2019 16:17:09 +0000 (-0500) Subject: MdePkg/DxeHstiLib: Added checks to improve error handling. X-Git-Tag: edk2-stable201911~310 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=17f8c9e97d770c74f84194576bcd97322fbed21e;p=mirror_edk2.git MdePkg/DxeHstiLib: Added checks to improve error handling. REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2138 Added checks for return parameters of GetSupportedTypes function calls in InternalHstiFindAip to improve error handling. An issue was observed on Dell Poweredge R740, where the Dell PERC H740P controller UEFI driver returned InfoTypesBuffer = NULL, InfoTypesBufferCount = 0 and caused an FreePool assert. Signed-off-by: Jayanth Raghuram Cc: Wei G Liu Reviewed-by: Liming Gao --- diff --git a/MdePkg/Library/DxeHstiLib/HstiDxe.c b/MdePkg/Library/DxeHstiLib/HstiDxe.c index 9466e3dcb3..4e1c67616b 100644 --- a/MdePkg/Library/DxeHstiLib/HstiDxe.c +++ b/MdePkg/Library/DxeHstiLib/HstiDxe.c @@ -77,7 +77,7 @@ InternalHstiFindAip ( &InfoTypesBuffer, &InfoTypesBufferCount ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR (Status) || (InfoTypesBuffer == NULL) || (InfoTypesBufferCount == 0)) { continue; }