From 19c2b1980d47f06866ac8e71d080a28a58f1a45e Mon Sep 17 00:00:00 2001 From: srs5694 Date: Wed, 23 Jan 2013 16:09:41 -0500 Subject: [PATCH] Fixed bug that caused ASSERT error on some systems if default_selection was not set. --- NEWS.txt | 4 ++++ docs/refind/getting.html | 13 +++++++------ refind.spec | 2 +- refind/main.c | 14 ++++++++------ 4 files changed, 20 insertions(+), 13 deletions(-) diff --git a/NEWS.txt b/NEWS.txt index 91267ca..d3c870c 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -1,6 +1,10 @@ 0.6.6 (?/??/2013): ------------------ +- Fixed bug that caused ASSERT error on some systems (and conceivably a + crash on startup on some) when default_selection line in refind.conf was + commented out or empty. + - Fixed bug that caused "Binary is whitelisted" message to persist on screen after loading MOK-signed drivers in Secure Boot mode. diff --git a/docs/refind/getting.html b/docs/refind/getting.html index 4ad26b0..bf803e7 100644 --- a/docs/refind/getting.html +++ b/docs/refind/getting.html @@ -216,12 +216,13 @@ computer.

Tianocore toolkit, and so support booting BIOS/legacy boot loaders on UEFI-based PCs. -
  • ALT Linux—This RPM-based distribution is experimenting - with using rEFInd on EFI-based computers. As I write, the ALT - developers haven't yet nailed down booting from an optical disc (it's a - tricky and delicate task, especially when preparing a "hybrid" image), - but they're working on the problem. They have an RPM of rEFInd, but I - don't have a download link.
  • +
  • ALT Linux—This RPM-based distribution is experimenting with + using rEFInd on EFI-based computers. As I write, the ALT developers haven't + yet nailed down booting from an optical disc (it's a tricky and delicate + task, especially when preparing a "hybrid" image), but they're working on + the problem. They have an RPM of rEFInd; see this page + for details.
  • Fat Dog—This variant of Puppy Linux uses a combination of diff --git a/refind.spec b/refind.spec index c61081a..3c30d47 100644 --- a/refind.spec +++ b/refind.spec @@ -1,6 +1,6 @@ Summary: EFI boot manager software Name: refind -Version: 0.6.5 +Version: 0.6.5.4 Release: 1%{?dist} Summary: EFI boot manager software License: GPLv3 diff --git a/refind/main.c b/refind/main.c index b9a8e18..1034927 100644 --- a/refind/main.c +++ b/refind/main.c @@ -128,7 +128,7 @@ static VOID AboutrEFInd(VOID) if (AboutMenu.EntryCount == 0) { AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT); - AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.6.5.2"); + AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.6.5.4"); AddMenuInfoLine(&AboutMenu, L""); AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer"); AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012 Roderick W. Smith"); @@ -604,12 +604,12 @@ VOID GenerateSubScreen(LOADER_ENTRY *Entry, IN REFIT_VOLUME *Volume) { // earlier.... if ((SubScreen->Entries != NULL) && (SubScreen->Entries[0] != NULL)) { MyFreePool(SubScreen->Entries[0]->Title); - SubScreen->Entries[0]->Title = StrDuplicate(TokenList[0]); + SubScreen->Entries[0]->Title = TokenList[0] ? StrDuplicate(TokenList[0]) : StrDuplicate(L"Boot Linux"); } // if FreeTokenLine(&TokenList, &TokenCount); while ((TokenCount = ReadTokenLine(File, &TokenList)) > 1) { SubEntry = InitializeLoaderEntry(Entry); - SubEntry->me.Title = StrDuplicate(TokenList[0]); + SubEntry->me.Title = TokenList[0] ? StrDuplicate(TokenList[0]) : StrDuplicate(L"Boot Linux"); MyFreePool(SubEntry->LoadOptions); SubEntry->LoadOptions = AddInitrdToOptions(TokenList[1], InitrdName); FreeTokenLine(&TokenList, &TokenCount); @@ -1921,7 +1921,7 @@ static VOID ScanForTools(VOID) { } // while if (FileExists(SelfDir, L"MokManager.efi")) { MyFreePool(FileName); - FileName = StrDuplicate(SelfDirPath); + FileName = SelfDirPath ? StrDuplicate(SelfDirPath) : NULL; MergeStrings(&FileName, L"\\MokManager.efi", 0); SPrint(Description, 255, L"MOK Key Manager at %s", FileName); AddToolEntry(SelfLoadedImage->DeviceHandle, FileName, Description, @@ -2018,7 +2018,7 @@ efi_main (EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) BOOLEAN MokProtocol; REFIT_MENU_ENTRY *ChosenEntry; UINTN MenuExit, i; - CHAR16 *Selection; + CHAR16 *Selection = NULL; EG_PIXEL BGColor; // bootstrap @@ -2061,7 +2061,9 @@ efi_main (EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) RescanAll(); } // if - Selection = StrDuplicate(GlobalConfig.DefaultSelection); + if (GlobalConfig.DefaultSelection) + Selection = StrDuplicate(GlobalConfig.DefaultSelection); + while (MainLoopRunning) { MenuExit = RunMainMenu(&MainMenu, Selection, &ChosenEntry); -- 2.39.2