diff options
author | Jim Meyering <meyering@redhat.com> | 2012-05-10 18:19:47 +0200 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2012-06-11 12:57:40 +0300 |
commit | 0614cb82ca27bdffb83864e693fc29e29182667b (patch) | |
tree | 850da9ec1039f39d7d05cccf9585ab231032e19e /hw/kvm | |
parent | dbaf26b3b22daae3be6a89b965e43503e7c3b912 (diff) | |
download | qemu-0614cb82ca27bdffb83864e693fc29e29182667b.zip qemu-0614cb82ca27bdffb83864e693fc29e29182667b.tar.gz qemu-0614cb82ca27bdffb83864e693fc29e29182667b.tar.bz2 |
kvm/apic: correct short memset
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 <meyering@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'hw/kvm')
-rw-r--r-- | hw/kvm/apic.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/kvm/apic.c b/hw/kvm/apic.c index 8ba4079..80e3e48 100644 --- a/hw/kvm/apic.c +++ b/hw/kvm/apic.c @@ -30,7 +30,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); |