diff --git a/MdePkg/Library/DxeServicesLib/DxeServicesLib.c b/MdePkg/Library/DxeServicesLib/DxeServicesLib.c index 107bf4bd62..45936d4abf 100644 --- a/MdePkg/Library/DxeServicesLib/DxeServicesLib.c +++ b/MdePkg/Library/DxeServicesLib/DxeServicesLib.c @@ -617,7 +617,7 @@ GetFileBufferByFilePath ( } } - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR (Status) && (FileInfo != NULL)) { // // Allocate space for the file //