diff options
author | Alberto Mardegan <mardy@users.sourceforge.net> | 2011-11-11 11:10:22 (GMT) |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2011-11-11 11:12:11 (GMT) |
commit | 00020eed3fa948f69cfa776e92121edec6f975cc (patch) | |
tree | 68889315553eaa4553368ecfb1cf662d1cde4d5f /src/dbus | |
parent | 054fa68b6ae852e84f2d44a73260b4282286f5ab (diff) | |
download | Qt-00020eed3fa948f69cfa776e92121edec6f975cc.zip Qt-00020eed3fa948f69cfa776e92121edec6f975cc.tar.gz Qt-00020eed3fa948f69cfa776e92121edec6f975cc.tar.bz2 |
Don't directly access QList contents
The existing code doesn't work on 64bit machines. We must first convert
the list into a QVector, which guarantees that elements are laid out
correctly as an array.
Merge-request: 1467
Reviewed-by: thiago
Diffstat (limited to 'src/dbus')
-rw-r--r-- | src/dbus/qdbuspendingcall.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/dbus/qdbuspendingcall.cpp b/src/dbus/qdbuspendingcall.cpp index ea84742..2278db4 100644 --- a/src/dbus/qdbuspendingcall.cpp +++ b/src/dbus/qdbuspendingcall.cpp @@ -180,9 +180,12 @@ bool QDBusPendingCallPrivate::setReplyCallback(QObject *target, const char *memb if (metaTypes.at(count) == QDBusMetaTypeId::message) --count; - // QList<int> is actually a vector - // kids, don't try this at home - setMetaTypes(count, count ? &metaTypes.at(1) : 0); + if (count == 0) { + setMetaTypes(count, 0); + } else { + QVector<int> types = QVector<int>::fromList(metaTypes); + setMetaTypes(count, types.constData() + 1); + } return true; } |