The TypeImpl was passed as ObjectClass and the ObjectClass as opaque,
leading to segfault when dereferencing the caller-supplied opaque.

Signed-off-by: Andreas Färber <afaer...@suse.de>
Cc: Anthony Liguori <aligu...@us.ibm.com>
---
 qom/object.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/qom/object.c b/qom/object.c
index a12895f..57cc592 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -478,7 +478,7 @@ static void object_class_foreach_tramp(gpointer key, 
gpointer value,
 
     type_class_init(type);
 
-    data->fn(value, type->class);
+    data->fn(type->class, data->opaque);
 }
 
 void object_class_foreach(void (*fn)(ObjectClass *klass, void *opaque),
-- 
1.7.7


Reply via email to