mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-25 06:46:00 +00:00
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>
This commit is contained in:
parent
632834ce6d
commit
11335c0439
1 changed files with 6 additions and 0 deletions
|
@ -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);
|
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)) {
|
if (!guidcmp(info_type, &efi_file_info_guid)) {
|
||||||
struct efi_file_info *info = buffer;
|
struct efi_file_info *info = buffer;
|
||||||
char *filename = basename(fh);
|
char *filename = basename(fh);
|
||||||
|
|
Loading…
Add table
Reference in a new issue