On 2012-05-10 13:19, Jim Meyering wrote:
> From: Jim Meyering <meyer...@redhat.com>
> 
> kvm_put_apic_state's attempt to clear *kapic before setting its
> bits cleared sizeof(void*) bytes (no more than 8) rather than the
> intended 1024 (KVM_APIC_REG_SIZE) bytes. Spotted by coverity.
> 
> Signed-off-by: Jim Meyering <meyer...@redhat.com>
> ---
>  hw/kvm/apic.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/kvm/apic.c b/hw/kvm/apic.c
> index ffe7a52..a0ab503 100644
> --- a/hw/kvm/apic.c
> +++ b/hw/kvm/apic.c
> @@ -29,7 +29,7 @@ void kvm_put_apic_state(DeviceState *d, struct 
> kvm_lapic_state *kapic)
>      APICCommonState *s = DO_UPCAST(APICCommonState, busdev.qdev, d);
>      int i;
> 
> -    memset(kapic, 0, sizeof(kapic));
> +    memset(kapic, 0, sizeof(*kapic));
>      kvm_apic_set_reg(kapic, 0x2, s->id << 24);
>      kvm_apic_set_reg(kapic, 0x8, s->tpr);
>      kvm_apic_set_reg(kapic, 0xd, s->log_dest << 24);

Yep, that's what I actually meant...

Thanks,
Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

Reply via email to