Fix crash in QDBusDemarshaller QStringList extraction
authorSami Rosendahl <ext-sami.1.rosendahl@nokia.com>
Mon, 5 Dec 2011 11:06:40 +0000 (13:06 +0200)
committerQt by Nokia <qt-info@nokia.com>
Sun, 25 Dec 2011 20:58:57 +0000 (21:58 +0100)
commitb4398dc4e372dbe829b21423e1a0a93a6a542994
tree9473bae08a2b2edcdccd5be3a6654f6424319235
parent8f19f142745f3cb0690dcd51cebc66153e396805
Fix crash in QDBusDemarshaller QStringList extraction

QDBusArgument QStringList extraction operator and QDBusDemarshaller that
implements the extraction do not check the type of the extracted value.
When extracting a QStringList and the value actually is e.g. an array of
bytes the string list extraction will crash as it interprets the bytes as
char pointers.

The fix adds DBus type checks to QDBusArgument QStringList extraction
operator implementations.
The checks are as permissive as possible provided crashes are avoided.

Task-number: QTBUG-22840
Change-Id: I4b67d75b59c5052d939f3a69f3e92dabdb3bdd6b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
src/dbus/qdbusargument_p.h
src/dbus/qdbusdemarshaller.cpp
tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp