diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2019-06-15 12:52:35 +0200 |
---|---|---|
committer | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2019-06-20 22:26:15 +0000 |
commit | 997c2ce5cf9e669ca2d6713954e50af29ceea914 (patch) | |
tree | b1a69f4843cf9d6470b72d69c09e535f0aad38f5 | |
parent | 3352b306bf63f79f2dc261b950be12bd41ba8bb1 (diff) |
efi_loader: QueryMode() check parameters
Check the parameters of EFI_GRAPHICS_OUTPUT_PROTOCOL.QueryMode().
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
-rw-r--r-- | lib/efi_loader/efi_gop.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/efi_loader/efi_gop.c b/lib/efi_loader/efi_gop.c index 9428c3b83c..c44a1cfc47 100644 --- a/lib/efi_loader/efi_gop.c +++ b/lib/efi_loader/efi_gop.c @@ -41,14 +41,21 @@ static efi_status_t EFIAPI gop_query_mode(struct efi_gop *this, u32 mode_number, struct efi_gop_mode_info **info) { struct efi_gop_obj *gopobj; + efi_status_t ret = EFI_SUCCESS; EFI_ENTRY("%p, %x, %p, %p", this, mode_number, size_of_info, info); + if (!this || !size_of_info || !info || mode_number) { + ret = EFI_INVALID_PARAMETER; + goto out; + } + gopobj = container_of(this, struct efi_gop_obj, ops); *size_of_info = sizeof(gopobj->info); *info = &gopobj->info; - return EFI_EXIT(EFI_SUCCESS); +out: + return EFI_EXIT(ret); } static efi_status_t EFIAPI gop_set_mode(struct efi_gop *this, u32 mode_number) |