diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2011-02-10 13:38:35 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2011-02-17 15:02:14 (GMT) |
commit | 1d8ebff955d357d3723487308e2906a12c6c043b (patch) | |
tree | d784db01d966a536401f448182bfccad0f2f6816 /src | |
parent | cc2db7a49c9208a00a913f7c4a410009814a5580 (diff) | |
download | Qt-1d8ebff955d357d3723487308e2906a12c6c043b.zip Qt-1d8ebff955d357d3723487308e2906a12c6c043b.tar.gz Qt-1d8ebff955d357d3723487308e2906a12c6c043b.tar.bz2 |
QtDBus: Make sure we can receive unknown types
We must make sure we advance the receiving iterator, or we end up in
an infinite loop.
Task-number: QTBUG-17476
Diffstat (limited to 'src')
-rw-r--r-- | src/dbus/qdbusdemarshaller.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/dbus/qdbusdemarshaller.cpp b/src/dbus/qdbusdemarshaller.cpp index 91dbf25..ac3b5fa 100644 --- a/src/dbus/qdbusdemarshaller.cpp +++ b/src/dbus/qdbusdemarshaller.cpp @@ -235,7 +235,12 @@ QVariant QDBusDemarshaller::toVariantInternal() // qWarning("QDBusDemarshaller: Found unknown D-Bus type %d '%c'", // q_dbus_message_iter_get_arg_type(&iterator), // q_dbus_message_iter_get_arg_type(&iterator)); - return QVariant(); + char *ptr = 0; + ptr += q_dbus_message_iter_get_arg_type(&iterator); + q_dbus_message_iter_next(&iterator); + + // I hope you never dereference this pointer! + return QVariant::fromValue<void *>(ptr); break; }; } |