[PATCH] grubby: do not crash when displaying "other" sections in grub.conf (#491622)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This fixes:
1. Add
title Other
        rootnoverify (hd0,0)
        chainloader +1
to grub.conf
2. Run "grubby --info ALL"
3. Segfault
---
 grubby/grubby.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/grubby/grubby.c b/grubby/grubby.c
index 1b1dea7..28a97d6 100644
--- a/grubby/grubby.c
+++ b/grubby/grubby.c
@@ -1433,6 +1433,11 @@ void displayEntry(struct singleEntry * entry, const char * prefix, int index) {
     printf("index=%d\n", index);
 
     line = getLineByType(LT_KERNEL|LT_HYPER, entry->lines);
+    if (!line) {
+        printf("non linux entry\n");
+        return;
+    }
+
     printf("kernel=%s\n", line->elements[1].item);
 
     if (line->numElements >= 3) {
-- 
1.6.2

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux