提交 fa995d0d 编写于 作者: H Heinrich Schuchardt 提交者: Alexander Graf

efi_loader: avoid NULL dereference in efi_get_memory_map()

We should only dereference parameter memory_map_size after checking that
it is valid.

Fixes: 8e835554 ("efi_loader: check parameters of GetMemoryMap")
Signed-off-by: NHeinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: NAlexander Graf <agraf@suse.de>
上级 3748ed90
......@@ -457,11 +457,13 @@ efi_status_t efi_get_memory_map(efi_uintn_t *memory_map_size,
efi_uintn_t map_size = 0;
int map_entries = 0;
struct list_head *lhandle;
efi_uintn_t provided_map_size = *memory_map_size;
efi_uintn_t provided_map_size;
if (!memory_map_size)
return EFI_INVALID_PARAMETER;
provided_map_size = *memory_map_size;
list_for_each(lhandle, &efi_mem)
map_entries++;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册