Am 10.05.2012 19:28, schrieb Jan Kiszka:
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
Reviewed-by: Stefan Weil <s...@weilnetz.de>
Hello Anthony,
this patch should be committed to QEMU 1.1.
I had sent a patch with the same fix 6 days later.
Regards,
Stefan W.