Blame SOURCES/0012-grub-Fix-a-crash-with-kernel-line-without-being-prec.patch

16aa69
From ae451cb921126aa965abfe79c8716b7367c690de Mon Sep 17 00:00:00 2001
16aa69
From: Lubomir Rintel <lkundrak@v3.sk>
16aa69
Date: Wed, 27 Nov 2013 16:59:48 +0100
16aa69
Subject: [PATCH 12/41] grub: Fix a crash with kernel line without being
16aa69
 preceded by title
16aa69
16aa69
Quite obviously this implies a broken configuration file where a lone kernel
16aa69
line is found without ever seeing an entry start, resulting in a NULL
16aa69
dereference attempt. Reproducible by running GRUB code against extlinux
16aa69
configuration:
16aa69
16aa69
./grubby --grub -c test/extlinux.1 --default-kernel
16aa69
grubby received SIGSEGV!  Backtrace (6):
16aa69
...
16aa69
16aa69
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
16aa69
---
16aa69
 grubby.c | 2 +-
16aa69
 1 file changed, 1 insertion(+), 1 deletion(-)
16aa69
16aa69
diff --git a/grubby.c b/grubby.c
16aa69
index 21c5044..3cded58 100644
16aa69
--- a/grubby.c
16aa69
+++ b/grubby.c
16aa69
@@ -1193,7 +1193,7 @@ static struct grubConfig * readConfig(const char * inName,
16aa69
 	     * lines came earlier in the template, make sure to use LT_HYPER 
16aa69
 	     * instead of LT_KERNEL now
16aa69
 	     */
16aa69
-	    if (entry->multiboot)
16aa69
+	    if (entry && entry->multiboot)
16aa69
 		line->type = LT_HYPER;
16aa69
 
16aa69
         } else if (line->type == LT_MBMODULE) {
16aa69
-- 
16aa69
2.4.3
16aa69