Skip to contentSkip to conversation

qom: Fix object_class_foreach()

PATCH New Andreas Färber 1 participant 1 message Jan 28, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qom: Fix object_class_foreach()

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

---
 qom/object.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
qom/object.c +1 -1
index a12895f..57cc592 100644
@@ -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),
Signature · 1 line
1.7.7