From: Stefan Weil <sw@weilnetz.de>
To: Anthony Liguori <aliguori@us.ibm.com>
Cc: Jan Kiszka <jan.kiszka@siemens.com>,
qemu-devel@nongnu.org, Stefan Weil <sw@weilnetz.de>
Subject: [Qemu-devel] [PATCH 1.1] kvm: Fix wrong size in memset
Date: Wed, 16 May 2012 07:53:13 +0200 [thread overview]
Message-ID: <1337147593-20587-1-git-send-email-sw@weilnetz.de> (raw)
Only the first 4 or 8 bytes were set to 0.
This bug was found by cppcheck.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
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);
--
1.7.10
next reply other threads:[~2012-05-16 5:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-16 5:53 Stefan Weil [this message]
2012-05-16 5:55 ` [Qemu-devel] [PATCH 1.1] kvm: Fix wrong size in memset Andreas Färber
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1337147593-20587-1-git-send-email-sw@weilnetz.de \
--to=sw@weilnetz.de \
--cc=aliguori@us.ibm.com \
--cc=jan.kiszka@siemens.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).