diff options
author | James Bottomley <JBottomley@Parallels.com> | 2013-03-05 10:30:01 +0000 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-03-05 10:30:01 +0000 |
commit | ba1950e12b4612747f85cb70d3393020122f2ca3 (patch) | |
tree | 221b675fedc85694ccbd20480e679011614ef41e | |
parent | 2f9cdf87c577cc6dfa8acc758bd2c39478b7bb69 (diff) | |
download | efitools-ba1950e12b4612747f85cb70d3393020122f2ca3.tar.gz |
variables: Fix SetMem cockup
SetMem takes the arguments dest, size, character, not like the unix memset
prototype (thanks EFI committe). Fix this in a couple of places where a
variable wasn't getting zeroed.
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r-- | Loader.c | 4 | ||||
-rw-r--r-- | lib/variables.c | 4 |
2 files changed, 4 insertions, 4 deletions
@@ -136,8 +136,8 @@ efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab) if (ask_install_keys()) { UINT8 sig[sizeof(EFI_SIGNATURE_LIST) + sizeof(EFI_SIGNATURE_DATA) - 1 + SHA256_DIGEST_SIZE]; EFI_SIGNATURE_LIST *l = (void *)sig; - EFI_SIGNATURE_DATA *d = (void *)sig + sizeof(EFI_SIGNATURE_LIST); - SetMem(sig, 0, sizeof(sig)); + EFI_SIGNATURE_DATA *d = (void *)(sig + sizeof(EFI_SIGNATURE_LIST)); + SetMem(sig, sizeof(sig), 0); l->SignatureType = EFI_CERT_SHA256_GUID; l->SignatureListSize = sizeof(sig); l->SignatureSize = 16 +32; /* UEFI defined */ diff --git a/lib/variables.c b/lib/variables.c index 9db6480..37bb1c1 100644 --- a/lib/variables.c +++ b/lib/variables.c @@ -319,8 +319,8 @@ variable_enroll_hash(CHAR16 *var, EFI_GUID owner, UINT8 sig[sizeof(EFI_SIGNATURE_LIST) + sizeof(EFI_SIGNATURE_DATA) - 1 + SHA256_DIGEST_SIZE]; EFI_SIGNATURE_LIST *l = (void *)sig; - EFI_SIGNATURE_DATA *d = (void *)sig + sizeof(EFI_SIGNATURE_LIST); - SetMem(sig, 0, sizeof(sig)); + EFI_SIGNATURE_DATA *d = (void *)(sig + sizeof(EFI_SIGNATURE_LIST)); + SetMem(sig, sizeof(sig), 0); l->SignatureType = EFI_CERT_SHA256_GUID; l->SignatureListSize = sizeof(sig); l->SignatureSize = 16 +32; /* UEFI defined */ |