Guest User

Untitled

a guest
Nov 24th, 2017
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.18 KB | None | 0 0
  1. From 1c48847ce6659f1c905148b56e1a4162c1944bbb Mon Sep 17 00:00:00 2001
  2. From: Frederik Gladhorn <frederik.gladhorn@nokia.com>
  3. Date: Tue, 13 Sep 2011 14:38:09 +0200
  4. Subject: [PATCH] Check argument count before accessing argument.
  5.  
  6. Also use QList::at instead of operator[].
  7.  
  8. Fixes: QTBUG-21403
  9. Reviewed-by: pending
  10. ---
  11. src/plugins/bearer/icd/qicdengine.cpp |    4 ++--
  12.  1 files changed, 2 insertions(+), 2 deletions(-)
  13.  
  14. diff --git a/src/plugins/bearer/icd/qicdengine.cpp b/src/plugins/bearer/icd/qicdengine.cpp
  15. index 79be2ce..ca2ea70 100644
  16. --- a/src/plugins/bearer/icd/qicdengine.cpp
  17. +++ b/src/plugins/bearer/icd/qicdengine.cpp
  18. @@ -883,12 +883,12 @@ void QIcdEngine::connectionStateSignalsSlot(QDBusMessage msg)
  19.      QMutexLocker locker(&mutex);
  20.  
  21.      QList<QVariant> arguments = msg.arguments();
  22. -    if (arguments[1].toUInt() != 0 || arguments.count() < 8) {
  23. +    if (arguments.count() < 8 || arguments.at(1).toUInt() != 0) {
  24.          return;
  25.      }
  26.  
  27.      QString iapid = arguments[5].toByteArray().data();
  28. -    uint icd_connection_state = arguments[7].toUInt();
  29. +    uint icd_connection_state = arguments.at(7).toUInt();
  30.  
  31.      switch (icd_connection_state) {
  32.      case ICD_STATE_CONNECTED:
  33. --
  34. 1.7.4.1
Add Comment
Please, Sign In to add comment