mirror of https://github.com/acidanthera/audk.git
Check the buffer allocation result before using it.
Signed-off-by:ydong10 Reviewed-by:jljusten git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11811 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
bf276b45b8
commit
cd8462ea9d
|
@ -56,6 +56,7 @@ FindHiiHandleViaDevPath(
|
|||
Status = HiiDb->ListPackageLists(HiiDb, EFI_HII_PACKAGE_DEVICE_PATH, NULL, &HandleBufferSize, HandleBuffer);
|
||||
if (Status == EFI_BUFFER_TOO_SMALL) {
|
||||
HandleBuffer = AllocateZeroPool(HandleBufferSize);
|
||||
ASSERT (HandleBuffer != NULL);
|
||||
Status = HiiDb->ListPackageLists(HiiDb, EFI_HII_PACKAGE_DEVICE_PATH, NULL, &HandleBufferSize, HandleBuffer);
|
||||
}
|
||||
if (EFI_ERROR(Status)) {
|
||||
|
@ -69,6 +70,7 @@ FindHiiHandleViaDevPath(
|
|||
Status = HiiDb->ExportPackageLists(HiiDb, HandleBuffer[LoopVariable], &MainBufferSize, MainBuffer);
|
||||
if (Status == EFI_BUFFER_TOO_SMALL) {
|
||||
MainBuffer = AllocateZeroPool(MainBufferSize);
|
||||
ASSERT (MainBuffer != NULL);
|
||||
Status = HiiDb->ExportPackageLists(HiiDb, HandleBuffer[LoopVariable], &MainBufferSize, MainBuffer);
|
||||
}
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue