mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-26 15:14:02 +02:00
Set *ImageHandle to NULL when LoadImage() returns EFI_ACCESS_DENIED.
Signed-off-by: niruiyu Reviewed-by: jljusten git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11783 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
e9668a606e
commit
31222776db
@ -1086,6 +1086,13 @@ CoreLoadImageCommon (
|
|||||||
OriginalFilePath
|
OriginalFilePath
|
||||||
);
|
);
|
||||||
if (EFI_ERROR (SecurityStatus) && SecurityStatus != EFI_SECURITY_VIOLATION) {
|
if (EFI_ERROR (SecurityStatus) && SecurityStatus != EFI_SECURITY_VIOLATION) {
|
||||||
|
if (SecurityStatus == EFI_ACCESS_DENIED) {
|
||||||
|
//
|
||||||
|
// Image was not loaded because the platform policy prohibits the image from being loaded.
|
||||||
|
// It's the only place we could meet EFI_ACCESS_DENIED.
|
||||||
|
//
|
||||||
|
*ImageHandle = NULL;
|
||||||
|
}
|
||||||
Status = SecurityStatus;
|
Status = SecurityStatus;
|
||||||
Image = NULL;
|
Image = NULL;
|
||||||
goto Done;
|
goto Done;
|
||||||
@ -1237,7 +1244,6 @@ Done:
|
|||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
if (Image != NULL) {
|
if (Image != NULL) {
|
||||||
CoreUnloadAndCloseImage (Image, (BOOLEAN)(DstBuffer == 0));
|
CoreUnloadAndCloseImage (Image, (BOOLEAN)(DstBuffer == 0));
|
||||||
*ImageHandle = NULL;
|
|
||||||
}
|
}
|
||||||
} else if (EFI_ERROR (SecurityStatus)) {
|
} else if (EFI_ERROR (SecurityStatus)) {
|
||||||
Status = SecurityStatus;
|
Status = SecurityStatus;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user