diff options
author | Frederik Gladhorn <frederik.gladhorn@nokia.com> | 2011-09-13 14:38:09 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-09-21 10:27:48 +0200 |
commit | 88dd8a25d8a15c92ae7aae391734dc7bcaade39d (patch) | |
tree | 2ff5548631306b388bd8a887958f261cf90933e3 /src/plugins/bearer | |
parent | b89ffb404cdfbbd08c6a5a892778ceaf0e4d8b87 (diff) |
Check argument count before accessing argument.
Also use QList::at instead of operator[].
Fixes: QTBUG-21403
Reviewed-by: Gabi
(cherry picked from commit 6997b836f445908cf53c1c96a69e3eb7ba535706)
Change-Id: I5d9de189e931b2b55fbd7baab0baad94adae352b
Reviewed-on: http://codereview.qt-project.org/4782
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de@nokia.com>
Diffstat (limited to 'src/plugins/bearer')
-rw-r--r-- | src/plugins/bearer/icd/qicdengine.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/bearer/icd/qicdengine.cpp b/src/plugins/bearer/icd/qicdengine.cpp index c793e52cf9..d79a513ec4 100644 --- a/src/plugins/bearer/icd/qicdengine.cpp +++ b/src/plugins/bearer/icd/qicdengine.cpp @@ -883,12 +883,12 @@ void QIcdEngine::connectionStateSignalsSlot(QDBusMessage msg) QMutexLocker locker(&mutex); QList<QVariant> arguments = msg.arguments(); - if (arguments[1].toUInt() != 0 || arguments.count() < 8) { + if (arguments.count() < 8 || arguments.at(1).toUInt() != 0) { return; } QString iapid = arguments[5].toByteArray().data(); - uint icd_connection_state = arguments[7].toUInt(); + uint icd_connection_state = arguments.at(7).toUInt(); switch (icd_connection_state) { case ICD_STATE_CONNECTED: |