mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-25 00:29:23 +00:00
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>
This commit is contained in:
1 parent
acc726f812
commit
bc58fded50
1 file changed
+3
@@ -327,6 +327,9 @@ grub_efi_get_filename (grub_efi_device_path_t *dp0)
|
|||||||
grub_size_t filesize = 0;
|
grub_size_t filesize = 0;
|
||||||
grub_efi_device_path_t *dp;
|
grub_efi_device_path_t *dp;
|
||||||
|
|
||||||
|
if (!dp0)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
dp = dp0;
|
dp = dp0;
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
|
|||||||
Reference in new issue
Block a user