summaryrefslogtreecommitdiffstats
path: root/src/dbus/qdbusargument_p.h
diff options
context:
space:
mode:
authorSami Rosendahl <ext-sami.1.rosendahl@nokia.com>2011-11-25 11:13:46 +0200
committerQt by Nokia <qt-info@nokia.com>2011-12-25 21:58:57 +0100
commit8f19f142745f3cb0690dcd51cebc66153e396805 (patch)
tree0fd9ef9ae9c0d53eafd25525fced783d45622ce2 /src/dbus/qdbusargument_p.h
parentbca775edaa22f383f319aae72799b6cb61bce48c (diff)
Fix crash in QDBusDemarshaller basic string-like type extraction
QDBusArgument string extraction operators and QDBusDemarshaller that implements the extraction do not check the type of the extracted value. When extracting string-like basic DBus type that actually is e.g. an integer the string extraction will crash as it blindly attempts to use the integer as a pointer to char. The fix adds DBus type checks to QDBusArgument string type extraction operator implementations. The checks are as permissive as possible provided crashes are avoided. Previously supported functionality of extracting an object path or type signature to a string type is retained. Task-number: QTBUG-22840 Change-Id: I29be1ae592658ca268c65ed692e1d42619d52280 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/dbus/qdbusargument_p.h')
-rw-r--r--src/dbus/qdbusargument_p.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/dbus/qdbusargument_p.h b/src/dbus/qdbusargument_p.h
index d8ca442920..3ecb798f31 100644
--- a/src/dbus/qdbusargument_p.h
+++ b/src/dbus/qdbusargument_p.h
@@ -201,6 +201,7 @@ public:
QVariant toVariantInternal();
QDBusArgument::ElementType currentType();
+ bool isCurrentTypeStringLike();
public:
DBusMessageIter iterator;
@@ -208,6 +209,9 @@ public:
private:
Q_DISABLE_COPY(QDBusDemarshaller)
+ QString toStringUnchecked();
+ QDBusObjectPath toObjectPathUnchecked();
+ QDBusSignature toSignatureUnchecked();
};
inline QDBusMarshaller *QDBusArgumentPrivate::marshaller()