diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2019-09-08 10:45:31 +0200 |
---|---|---|
committer | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2019-09-09 15:21:09 +0200 |
commit | 11335c0439aa76bc5ed32b1ccfcab9995e2eac6b (patch) | |
tree | 02bfd3f49f05c0ba574b9ecbbc8aa0ad5b4a0d50 /lib | |
parent | 632834ce6dc9905cb101c91903e8bea5224e1b72 (diff) | |
download | u-boot-11335c0439aa76bc5ed32b1ccfcab9995e2eac6b.tar.gz |
efi_loader: check parameters EFI_FILE_PROTOCOL.GetInfo()
Check the parameters of EFI_FILE_PROTOCOL.GetInfo() to avoid possible NULL
dereference.
Check the buffer size for EFI_FILE_SYSTEM_INFO.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/efi_loader/efi_file.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/efi_loader/efi_file.c b/lib/efi_loader/efi_file.c index 3a108c6bf7..71582e5149 100644 --- a/lib/efi_loader/efi_file.c +++ b/lib/efi_loader/efi_file.c @@ -596,6 +596,12 @@ static efi_status_t EFIAPI efi_file_getinfo(struct efi_file_handle *file, EFI_ENTRY("%p, %pUl, %p, %p", file, info_type, buffer_size, buffer); + if (!file || !info_type || !buffer_size || + (*buffer_size && !buffer)) { + ret = EFI_INVALID_PARAMETER; + goto error; + } + if (!guidcmp(info_type, &efi_file_info_guid)) { struct efi_file_info *info = buffer; char *filename = basename(fh); |