diff options
| -rw-r--r-- | lib/variables.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/variables.c b/lib/variables.c index 57875e26..9f5b2b57 100644 --- a/lib/variables.c +++ b/lib/variables.c @@ -224,6 +224,9 @@ get_variable_attr(const CHAR16 * const var, UINT8 **data, UINTN *len, { EFI_STATUS efi_status; + if (!len) + return EFI_INVALID_PARAMETER; + *len = 0; efi_status = gRT->GetVariable((CHAR16 *)var, &owner, NULL, len, NULL); @@ -233,6 +236,9 @@ get_variable_attr(const CHAR16 * const var, UINT8 **data, UINTN *len, return efi_status; } + if (!data) + return EFI_INVALID_PARAMETER; + /* * Add three zero pad bytes; at least one correctly aligned UCS-2 * character. |
