efi: check *path non-null before grub_strrchr
authorLeif Lindholm <leif.lindholm@linaro.org>
Mon, 17 Nov 2014 14:11:01 +0000 (14:11 +0000)
committerLeif Lindholm <leif.lindholm@linaro.org>
Mon, 17 Nov 2014 14:11:01 +0000 (14:11 +0000)
commit004a2b1efdd782cf946387d2060ad9250d61c435
tree71c8f1881b7784f3218260c49fdf912619159da1
parent72ec399ad8d6348b6c74ea63d80c79784c8b84ae
efi: check *path non-null before grub_strrchr

The EFI version of grub_machine_get_bootlocation crops the boot image
name back to the last / in order to get a directory path. However, it
does not check that *name is actually set before calling grub_strrchr
to do this, and neither does grub_strrchr before dereferencing a NULL
pointer.

Parent function, grub_set_prefix_and_root, does check the pointer
before using.
ChangeLog
grub-core/kern/efi/init.c