grubby/0007-Always-error-check-getLineByType.patch

33 lines
882 B
Diff
Raw Normal View History

From e3a293332591f44a190775a3b4dceefe2e5118a1 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Thu, 25 Sep 2014 13:24:15 -0400
Subject: [PATCH 07/10] Always error check getLineByType()
Signed-off-by: Peter Jones <pjones@redhat.com>
---
grubby.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/grubby.c b/grubby.c
index baf646b..b202b6e 100644
--- a/grubby.c
+++ b/grubby.c
@@ -2369,9 +2369,11 @@ void displayEntry(struct singleEntry * entry, const char * prefix, int index) {
} else {
char * title;
line = getLineByType(LT_MENUENTRY, entry->lines);
- title = grub2ExtractTitle(line);
- if (title)
- printf("title=%s\n", title);
+ if (line) {
+ title = grub2ExtractTitle(line);
+ if (title)
+ printf("title=%s\n", title);
+ }
}
for (j = 0, line = entry->lines; line; line = line->next) {
--
1.9.3