summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2012-08-29 08:52:37 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2012-08-29 08:23:40 -0500
commit998a74bcda7f3297813732ddc2f28ffe5a12e37a (patch)
treef781863c785802f41034381ebea8eafa3d38b1b2
parentMerge remote-tracking branch 'bonzini/scsi-next' into staging (diff)
downloadqemu-kvm-998a74bcda7f3297813732ddc2f28ffe5a12e37a.tar.gz
qemu-kvm-998a74bcda7f3297813732ddc2f28ffe5a12e37a.tar.bz2
qemu-kvm-998a74bcda7f3297813732ddc2f28ffe5a12e37a.zip
hw/arm_gic.c: Define .class_size in arm_gic_info TypeInfo
Add the missing .class_size definition to the arm_gic_info TypeInfo. This fixes the memory corruption and possible segfault that otherwise results when the class struct is allocated at too small a size and the class init function writes off the end of it. Reported-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r--hw/arm_gic.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/arm_gic.c b/hw/arm_gic.c
index 186ac66f0..55871fad1 100644
--- a/hw/arm_gic.c
+++ b/hw/arm_gic.c
@@ -703,6 +703,7 @@ static TypeInfo arm_gic_info = {
.parent = TYPE_ARM_GIC_COMMON,
.instance_size = sizeof(gic_state),
.class_init = arm_gic_class_init,
+ .class_size = sizeof(ARMGICClass),
};
static void arm_gic_register_types(void)