From: Eric Snowberg Date: Tue, 28 Nov 2017 19:51:39 +0000 (-0800) Subject: ieee1275: Fix segfault in grub-ofpathname X-Git-Url: https://iam.tj/gitweb/gitweb.cgi?p=grub.git;a=commitdiff_plain;h=2dc163bf692c18275de7b0d6716138c676e3bf92 ieee1275: Fix segfault in grub-ofpathname Signed-off-by: Eric Snowberg Reviewed-by: Daniel Kiper --- diff --git a/util/ieee1275/grub-ofpathname.c b/util/ieee1275/grub-ofpathname.c index 8e5d766cb..300fbddad 100644 --- a/util/ieee1275/grub-ofpathname.c +++ b/util/ieee1275/grub-ofpathname.c @@ -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);