ACK: [PATCH] efi_runtime: memset the entire structure (LP: #1198236)
Alex Hung
alex.hung at canonical.com
Mon Jul 8 01:53:11 UTC 2013
On 07/05/2013 11:44 PM, Colin King wrote:
> 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;
>
Acked-by: Alex Hung <alex.hung at canonical.com>
More information about the fwts-devel
mailing list