Skip to contentSkip to conversation

ieee1275: fix segfault in grub-ofpathname

PATCH RESEND In review Eric Snowberg 2 participants 3 messages Nov 28, 2017 – Dec 6, 2017

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 ieee1275: fix segfault in grub-ofpathname

fix segfault in grub-ofpathname

---
Originally sent on Wed, 29 Jun 2016 14:43:18 -0700
http://lists.gnu.org/archive/html/grub-devel/2016-06/msg00033.html

---
 util/ieee1275/grub-ofpathname.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
util/ieee1275/grub-ofpathname.c +3 -1
index 8e5d766cb..300fbddad 100644
@@ -46,7 +46,9 @@ int main(int argc, char **argv)
     }
 
   of_path = grub_util_devname_to_ofpath (argv[1]);
-  printf("%s\n", of_path);
+
+  if (of_path)
+    printf ("%s\n", of_path);
 
   free (of_path);