ieee1275: NULL pointer dereference in grub_machine_get_bootlocation()
Read from NULL pointer canon in function grub_machine_get_bootlocation(). Function grub_ieee1275_canonicalise_devname() may return NULL. Signed-off-by: Eric Snowberg <eric.snowberg@oracle.com> Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
parent
b0beba9f20
commit
a5b5432211
1 changed files with 2 additions and 0 deletions
|
@ -110,6 +110,8 @@ grub_machine_get_bootlocation (char **device, char **path)
|
||||||
char *ptr;
|
char *ptr;
|
||||||
dev = grub_ieee1275_get_aliasdevname (bootpath);
|
dev = grub_ieee1275_get_aliasdevname (bootpath);
|
||||||
canon = grub_ieee1275_canonicalise_devname (dev);
|
canon = grub_ieee1275_canonicalise_devname (dev);
|
||||||
|
if (! canon)
|
||||||
|
return;
|
||||||
ptr = canon + grub_strlen (canon) - 1;
|
ptr = canon + grub_strlen (canon) - 1;
|
||||||
while (ptr > canon && (*ptr == ',' || *ptr == ':'))
|
while (ptr > canon && (*ptr == ',' || *ptr == ':'))
|
||||||
ptr--;
|
ptr--;
|
||||||
|
|
Loading…
Reference in a new issue