Message ID | 1373039098-25375-1-git-send-email-colin.king@canonical.com |
---|---|
State | Accepted |
Headers | show |
On 07/05/2013 11:44 PM, Colin King wrote: > From: Colin Ian King <colin.king@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@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@canonical.com>
On 07/05/2013 11:44 PM, Colin King wrote: > From: Colin Ian King <colin.king@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@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; > Thanks for spotting this. Acked-by: Ivan Hu <ivan.hu@canonical.com>
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;