mirror of
https://github.com/CloverHackyColor/CloverBootloader.git
synced 2024-11-10 09:40:53 +01:00
Crash in LoadLatestNvramPlist when EfiLibOpenRoot returns null.
This commit is contained in:
parent
bf74520cef
commit
2b84ee61a3
@ -964,9 +964,17 @@ LoadLatestNvramPlist()
|
||||
if (!EFI_ERROR(Status) && HandleCount > 0) {
|
||||
for (UINTN indexHandle = 0; indexHandle < HandleCount; indexHandle++) {
|
||||
RootDir = EfiLibOpenRoot(Handles[indexHandle]);
|
||||
if ( RootDir == NULL ) {
|
||||
DBG(" - [%lld] cannot open - skipping!\n", indexHandle);
|
||||
continue;
|
||||
}
|
||||
Status = RootDir->Open(RootDir, &FileHandle, L"nvram.plist", EFI_FILE_MODE_READ, 0);
|
||||
if (EFI_ERROR(Status)) {
|
||||
DBG(" - [%lld] no nvram.plist - skipping!\n", indexHandle);
|
||||
if ( Status == EFI_NOT_FOUND ) {
|
||||
DBG(" - [%lld] no nvram.plist\n", indexHandle);
|
||||
}else{
|
||||
DBG(" - [%lld] Cannot open nvram.plist - %s\n", indexHandle, efiStrError(Status));
|
||||
}
|
||||
continue;
|
||||
}
|
||||
FileInfo = EfiLibFileInfo(FileHandle);
|
||||
@ -1077,7 +1085,7 @@ LoadLatestNvramPlist()
|
||||
// DBG(" nvram.plist not found!\n");
|
||||
// }
|
||||
#endif
|
||||
DBG("loaded Status=%s\n", efiStrError(Status));
|
||||
DBG("LoadLatestNvramPlist loaded Status=%s\n", efiStrError(Status));
|
||||
return Status;
|
||||
}
|
||||
|
||||
@ -1096,7 +1104,7 @@ PutNvramPlistToRtVars ()
|
||||
if (gNvramDict == NULL) {
|
||||
/*Status = */LoadLatestNvramPlist();
|
||||
if (gNvramDict == NULL) {
|
||||
DBG("PutNvramPlistToRtVars: nvram.plist not found\n");
|
||||
DBG("PutNvramPlistToRtVars: no nvram.plist\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -83,6 +83,9 @@ EFI_STATUS Self::_initialize()
|
||||
}
|
||||
|
||||
m_efiFileName = m_CloverDirFullPath.basename();
|
||||
#ifdef JIEF_DEBUG
|
||||
DBG("m_efiFileName=%ls\n", m_efiFileName.wc_str());
|
||||
#endif
|
||||
|
||||
// History : if this Clover was started as BootX64.efi, redirect to /EFI/CLOVER
|
||||
if ( m_CloverDirFullPath.isEqualIC("\\EFI\\Boot\\BootX64.efi") ) {
|
||||
|
@ -193,9 +193,9 @@ static EFI_STATUS LoadEFIImageList(IN EFI_DEVICE_PATH **DevicePaths,
|
||||
#ifdef JIEF_DEBUG
|
||||
EFI_LOADED_IMAGE_PROTOCOL* loadedBootImage = NULL;
|
||||
if (!EFI_ERROR(Status = gBS->HandleProtocol(ChildImageHandle, &gEfiLoadedImageProtocolGuid, (void**)(&loadedBootImage)))) {
|
||||
DBG("%ls : Image base = 0x%llx", ImageTitle.wc_str(), (uintptr_t)loadedBootImage->ImageBase); // Jief : Do not change this, it's used by grep to feed the debugger
|
||||
DBG("%ls : Image base = 0x%llx\n", ImageTitle.wc_str(), (uintptr_t)loadedBootImage->ImageBase); // Jief : Do not change this, it's used by grep to feed the debugger
|
||||
}else{
|
||||
DBG("Can't get loaded image protocol");
|
||||
DBG("Can't get loaded image protocol\n");
|
||||
}
|
||||
#endif
|
||||
goto bailout;
|
||||
|
Loading…
Reference in New Issue
Block a user