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

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