summaryrefslogtreecommitdiff
path: root/lib/efi_loader
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2020-07-07 04:10:12 +0300
committerHeinrich Schuchardt <xypron.glpk@gmx.de>2020-07-12 00:14:16 +0300
commita27c78fddbbafcace558368a92f9b9fdaeee8b5c (patch)
treefe7bf91fa4e0f49e11228b85536e47667f375b5c /lib/efi_loader
parent1047c6e23c9bf7e2e0b0c0539b6d7289627c9f71 (diff)
downloadu-boot-a27c78fddbbafcace558368a92f9b9fdaeee8b5c.tar.xz
efi_loader: NULL dereference in efi_convert_pointer
Avoid a possible NULL pointer dereference in efi_convert_pointer(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'lib/efi_loader')
-rw-r--r--lib/efi_loader/efi_runtime.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/efi_loader/efi_runtime.c b/lib/efi_loader/efi_runtime.c
index c0bd99b867..121e2f65c6 100644
--- a/lib/efi_loader/efi_runtime.c
+++ b/lib/efi_loader/efi_runtime.c
@@ -499,7 +499,7 @@ static __efi_runtime efi_status_t EFIAPI efi_convert_pointer_runtime(
static __efi_runtime efi_status_t EFIAPI efi_convert_pointer(
efi_uintn_t debug_disposition, void **address)
{
- efi_physical_addr_t addr = (uintptr_t)*address;
+ efi_physical_addr_t addr;
efi_uintn_t i;
efi_status_t ret = EFI_NOT_FOUND;
@@ -515,6 +515,7 @@ static __efi_runtime efi_status_t EFIAPI efi_convert_pointer(
goto out;
}
+ addr = (uintptr_t)*address;
for (i = 0; i < efi_descriptor_count; i++) {
struct efi_mem_desc *map = (void *)efi_virtmap +
(efi_descriptor_size * i);