[PATCH] efi_runtime: memset the entire structure (LP: #1198236)
Colin King
colin.king at canonical.com
Fri Jul 5 15:44:58 UTC 2013
From: Colin Ian King <colin.king at canonical.com>
convert_to_efi_time() is only memset'ing eft to the size of a
pointer and not the size of eft_time_t, so just the first 4 or 8
bytes (depending on the arch) are being cleared.
Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
efi_runtime/efi_runtime.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/efi_runtime/efi_runtime.c b/efi_runtime/efi_runtime.c
index b08ce0e..7e3e949 100644
--- a/efi_runtime/efi_runtime.c
+++ b/efi_runtime/efi_runtime.c
@@ -60,7 +60,7 @@ static void convert_from_efi_time(efi_time_t *eft, EFI_TIME *time)
static void convert_to_efi_time(efi_time_t *eft, EFI_TIME *time)
{
- memset(eft, 0, sizeof(eft));
+ memset(eft, 0, sizeof(*eft));
eft->year = time->Year;
eft->month = time->Month;
eft->day = time->Day;
--
1.8.1.2
More information about the fwts-devel
mailing list