]> git.ipfire.org Git - thirdparty/grub.git/commit
efi: Avoid NULL dereference if FilePath is NULL
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Wed, 17 Apr 2019 05:12:56 +0000 (07:12 +0200)
committerDaniel Kiper <daniel.kiper@oracle.com>
Tue, 23 Apr 2019 09:33:02 +0000 (11:33 +0200)
commitbc58fded5074d139ab61aa510fdcbbcefa304c77
treefb4f5c70b37122f761f0929017e8d7d6cba419b0
parentacc726f812a907ee70f9ee6f8d29c1d9c57c73e1
efi: Avoid NULL dereference if FilePath is NULL

The UEFI specification allows LoadImage() to be called with a memory
location only and without a device path. In this case FilePath will not be
set in the EFI_LOADED_IMAGE_PROTOCOL.

So in function grub_efi_get_filename() the device path argument may be
NULL. As we cannot determine the device path in this case just return NULL
from the function.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/kern/efi/efi.c