grub-devel
[Top][All Lists]
Advanced

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

Re: Bug#891773: Related bug #871229 (but it didn't break my system))


From: John Paul Adrian Glaubitz
Subject: Re: Bug#891773: Related bug #871229 (but it didn't break my system))
Date: Thu, 1 Mar 2018 16:34:51 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

On 03/01/2018 04:06 PM, John Paul Adrian Glaubitz wrote:
Let me test a patch.

The problem is that of_path is empty here and the strcat tries
to append "disk" to an empty buffer which fails.

This fixes it for me:

diff --git a/grub-core/osdep/linux/ofpath.c b/grub-core/osdep/linux/ofpath.c
index 1c30e7233..da0000f0f 100644
--- a/grub-core/osdep/linux/ofpath.c
+++ b/grub-core/osdep/linux/ofpath.c
@@ -389,8 +389,13 @@ of_path_of_nvme(const char *sys_devname 
__attribute__((unused)),
     }
of_path = find_obppath (sysfs_path);
+
+  if(of_path)
+    strcat (of_path, disk);
+  else
+    of_path = strdup(disk);
+
   free (sysfs_path);
-  strcat (of_path, disk);
   return of_path;
 }

address@hidden:..glaubitz/grub> ./grub-probe --device /dev/nvme0n1 
--target=hints_string
--hint-ieee1275='ieee1275//address@hidden'
address@hidden:..glaubitz/grub>

I'll send a patch upstream.

Adrian

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - address@hidden
`. `'   Freie Universitaet Berlin - address@hidden
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



reply via email to

[Prev in Thread] Current Thread [Next in Thread]