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

56d25d
From ae451cb921126aa965abfe79c8716b7367c690de Mon Sep 17 00:00:00 2001
ae2804
From: Lubomir Rintel <lkundrak@v3.sk>
ae2804
Date: Wed, 27 Nov 2013 16:59:48 +0100
56d25d
Subject: [PATCH 12/41] 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
56d25d
index 21c5044..3cded58 100644
ae2804
--- a/grubby.c
ae2804
+++ b/grubby.c
56d25d
@@ -1193,7 +1193,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
-- 
56d25d
2.4.3
ae2804