Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From 1c48847ce6659f1c905148b56e1a4162c1944bbb Mon Sep 17 00:00:00 2001
- From: Frederik Gladhorn <frederik.gladhorn@nokia.com>
- Date: Tue, 13 Sep 2011 14:38:09 +0200
- Subject: [PATCH] Check argument count before accessing argument.
- Also use QList::at instead of operator[].
- Fixes: QTBUG-21403
- Reviewed-by: pending
- ---
- 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 79be2ce..ca2ea70 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:
- --
- 1.7.4.1
Add Comment
Please, Sign In to add comment