aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2020-12-27 15:46:00 +0100
committerHeinrich Schuchardt <xypron.glpk@gmx.de>2020-12-31 14:33:07 +0100
commit2a68cd492e91692f33425d02e7a0dcb24e06efc9 (patch)
treee5f361ab941555fbc235457a29958b694789118e
parent97d36f069d3362cd09b481fba94ee1de01a1f51b (diff)
downloadu-boot-2a68cd492e91692f33425d02e7a0dcb24e06efc9.zip
u-boot-2a68cd492e91692f33425d02e7a0dcb24e06efc9.tar.gz
u-boot-2a68cd492e91692f33425d02e7a0dcb24e06efc9.tar.bz2
efi_loader: avoid invalid free
load_options passed from do_efibootmgr() to do_bootefi_exec() may contain invalid data from the stack which will lead to an invalid free(). Fixes: 0ad64007feb9 ("efi_loader: set load options in boot manager") Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
-rw-r--r--lib/efi_loader/efi_bootmgr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/efi_loader/efi_bootmgr.c b/lib/efi_loader/efi_bootmgr.c
index 61dc72a..d3be2f9 100644
--- a/lib/efi_loader/efi_bootmgr.c
+++ b/lib/efi_loader/efi_bootmgr.c
@@ -275,7 +275,7 @@ static efi_status_t try_load_entry(u16 n, efi_handle_t *handle,
memcpy(*load_options, lo.optional_data, size);
ret = efi_set_load_options(*handle, size, *load_options);
} else {
- load_options = NULL;
+ *load_options = NULL;
}
error: