diff --git a/ChangeLog b/ChangeLog index 87faadf48..07d06465d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2014-01-07 Leif Lindholm + + * grub-core/kern/efi/init.c: check value of *path before + dereferencing. + 2014-11-03 Michael Chang * grub-core/net/icmp6.c (grub_net_recv_icmp6_packet): Fix size diff --git a/grub-core/kern/efi/init.c b/grub-core/kern/efi/init.c index 942ab0256..e9c85de12 100644 --- a/grub-core/kern/efi/init.c +++ b/grub-core/kern/efi/init.c @@ -63,10 +63,13 @@ grub_machine_get_bootlocation (char **device, char **path) if (!*device && grub_efi_net_config) grub_efi_net_config (image->device_handle, device, path); - /* Get the directory. */ - p = grub_strrchr (*path, '/'); - if (p) - *p = '\0'; + if (*path) + { + /* Get the directory. */ + p = grub_strrchr (*path, '/'); + if (p) + *p = '\0'; + } } void