[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kdelibs4support] src/solid-networkstatus/kded: Fix crash when WICD is not available
From:       Dan_Vrátil <dvratil () redhat ! com>
Date:       2015-10-05 14:13:58
Message-ID: E1Zj6Wc-0004Qn-By () scm ! kde ! org
[Download RAW message or body]

Git commit d24777cbb84fe44af89a6ccae0243193a803d66f by Dan Vrátil.
Committed on 05/10/2015 at 14:13.
Pushed by dvratil into branch 'master'.

Fix crash when WICD is not available

When WICD is not available, message is a QDBusMessage::ErrorMessage which has
exactly one argument (the error message) so none of the existing checks would
catch it. The code then tried to get a QDBusArgument from the message arguments
but gets an invalid one because the argument in fact is a QString. Invalid
QDBusArgument does not allow read nor write, and invokes qFatal() in
QDBusArgumentPrivate::checkRead() when we try to deserialize it (when Qt is built
in debug mode).

M  +5    -0    src/solid-networkstatus/kded/wicdstatus.cpp

http://commits.kde.org/kdelibs4support/d24777cbb84fe44af89a6ccae0243193a803d66f

diff --git a/src/solid-networkstatus/kded/wicdstatus.cpp b/src/solid-networkstatus/kded/wicdstatus.cpp
index 45602d1..90d922f 100644
--- a/src/solid-networkstatus/kded/wicdstatus.cpp
+++ b/src/solid-networkstatus/kded/wicdstatus.cpp
@@ -65,6 +65,11 @@ void WicdStatus::wicdStateChanged()
     Solid::Networking::Status status = Solid::Networking::Unknown;
     QDBusMessage message = m_wicd.call("GetConnectionStatus");
 
+    if (message.type() == QDBusMessage::ErrorMessage) {
+        emit statusChanged( status );
+        return;
+    }
+
     if (message.arguments().count() == 0) {
         emit statusChanged( status );
         return;
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic