Fixed uninitialized memory in QMetaObjectBuilder::fromRelocatableData
static_metacall was never set on the metaobject written by QMetaObjectBuilder::fromRelocatableData, sometimes causing a crash. It should be initialized to 0. Change-Id: I79373d895e131f0cc2ff1af6d2177a0c1a282be7 Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>bb10
parent
e1d5355325
commit
40a73d7c63
|
|
@ -1536,6 +1536,7 @@ void QMetaObjectBuilder::fromRelocatableData(QMetaObject *output,
|
|||
output->d.data = reinterpret_cast<const uint *>(buf + dataOffset);
|
||||
output->d.extradata = 0;
|
||||
output->d.relatedMetaObjects = 0;
|
||||
output->d.static_metacall = 0;
|
||||
}
|
||||
|
||||
/*!
|
||||
|
|
|
|||
|
|
@ -1097,6 +1097,11 @@ void tst_QMetaObjectBuilder::relocatableData()
|
|||
QMetaObject *meta = builder.toMetaObject();
|
||||
|
||||
QVERIFY(sameMetaObject(meta, &meta2));
|
||||
|
||||
QVERIFY(!meta2.d.extradata);
|
||||
QVERIFY(!meta2.d.relatedMetaObjects);
|
||||
QVERIFY(!meta2.d.static_metacall);
|
||||
|
||||
free(meta);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue