Function grub_strndup() may return NULL, this is called from
function grub_ieee1275_get_devname() which is then called from
function grub_ieee1275_encode_devname() to set device. The device
variable could then be used with a NULL pointer.
Signed-off-by: Eric Snowberg <eric.snowberg@oracle.com>
Reviewed-by: Colin Watson <cjwatson@ubuntu.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
char *optr;
const char *iptr;
+ if (! device)
+ return 0;
+
encoding = grub_malloc (sizeof ("ieee1275/") + 2 * grub_strlen (device)
+ sizeof (",XXXXXXXXXXXX"));
if (!encoding)