]> code.delx.au - refind/commitdiff
Fixed bug that caused crash when an empty refind_linux.conf file was
authorsrs5694 <srs5694@users.sourceforge.net>
Wed, 8 Apr 2015 14:31:10 +0000 (10:31 -0400)
committersrs5694 <srs5694@users.sourceforge.net>
Wed, 8 Apr 2015 14:31:10 +0000 (10:31 -0400)
encountered.

NEWS.txt
refind/config.c
refind/main.c

index 71d48ad3f1db5af144ec35d25c0a114e3fab287c..98030acf308f908ab7ae79937ea4cea4adbaeaec 100644 (file)
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -1,6 +1,9 @@
 0.8.8 (3/??/2015):
 ------------------
 
 0.8.8 (3/??/2015):
 ------------------
 
+- Fixed bug that caused a rEFInd crash if an empty refind_linux.conf
+  file was encountered.
+
 - The mkrlconf.sh script now checks the OS on which it's running, which
   should help avoid confusion or problems by users who mistakenly run it
   under OS X.
 - The mkrlconf.sh script now checks the OS on which it's running, which
   should help avoid confusion or problems by users who mistakenly run it
   under OS X.
index 573a5dbe5e67de37e9a3efe8ac83bfcf2486be15..fa1d9a6f53857a1c236fb679322060eeb92c3d2b 100644 (file)
@@ -267,6 +267,10 @@ UINTN ReadTokenLine(IN REFIT_FILE *File, OUT CHAR16 ***TokenList)
         Line = ReadLine(File);
         if (Line == NULL)
             return(0);
         Line = ReadLine(File);
         if (Line == NULL)
             return(0);
+        if (Line[0] == L'\0') {
+            MyFreePool(Line);
+            return(0);
+        } // if
 
         p = Line;
         LineFinished = FALSE;
 
         p = Line;
         LineFinished = FALSE;
index 3f40c1282b6d37cf7159169cc372d43df33fba02..c107fa4f9997ffd1ae4259f069eff212f2a7a6c1 100644 (file)
@@ -166,7 +166,7 @@ static VOID AboutrEFInd(VOID)
 
     if (AboutMenu.EntryCount == 0) {
         AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT);
 
     if (AboutMenu.EntryCount == 0) {
         AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT);
-        AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.8.7.3");
+        AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.8.7.4");
         AddMenuInfoLine(&AboutMenu, L"");
         AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer");
         AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012-2015 Roderick W. Smith");
         AddMenuInfoLine(&AboutMenu, L"");
         AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer");
         AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012-2015 Roderick W. Smith");
@@ -773,7 +773,7 @@ VOID GenerateSubScreen(LOADER_ENTRY *Entry, IN REFIT_VOLUME *Volume) {
          // first entry requires special processing, since it was initially set
          // up with a default title but correct options by InitializeSubScreen(),
          // earlier....
          // first entry requires special processing, since it was initially set
          // up with a default title but correct options by InitializeSubScreen(),
          // earlier....
-         if ((SubScreen->Entries != NULL) && (SubScreen->Entries[0] != NULL)) {
+         if ((TokenCount > 1) && (SubScreen->Entries != NULL) && (SubScreen->Entries[0] != NULL)) {
             MyFreePool(SubScreen->Entries[0]->Title);
             SubScreen->Entries[0]->Title = TokenList[0] ? StrDuplicate(TokenList[0]) : StrDuplicate(L"Boot Linux");
          } // if
             MyFreePool(SubScreen->Entries[0]->Title);
             SubScreen->Entries[0]->Title = TokenList[0] ? StrDuplicate(TokenList[0]) : StrDuplicate(L"Boot Linux");
          } // if