summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2019-05-17 12:47:17 +0200
committerHeinrich Schuchardt <xypron.glpk@gmx.de>2019-05-19 08:10:10 +0200
commit1344f7d0f61d94fe475aeadb000ac6cafccd3920 (patch)
treee59a9e5bdab3ecc9bd4575bd2bb4da680caa89bc
parentdb80fe3866c60dc263b50c4c3724c72e91d6fe04 (diff)
efi_loader: GetNextMonotonicCount() check parameter
Do not write to address indicated by NULL pointer. UEFI SCT II 2.6 (2017), 3.6.5 GetNextMonotonicCount(), 5.1.5.5.1 Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
-rw-r--r--lib/efi_loader/efi_boottime.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index ce6ca06f75..971bd5ffa3 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -1916,10 +1916,17 @@ static efi_status_t EFIAPI efi_exit_boot_services(efi_handle_t image_handle,
static efi_status_t EFIAPI efi_get_next_monotonic_count(uint64_t *count)
{
static uint64_t mono;
+ efi_status_t ret;
EFI_ENTRY("%p", count);
+ if (!count) {
+ ret = EFI_INVALID_PARAMETER;
+ goto out;
+ }
*count = mono++;
- return EFI_EXIT(EFI_SUCCESS);
+ ret = EFI_SUCCESS;
+out:
+ return EFI_EXIT(ret);
}
/**