telepathy-qt: Avoid trying to load invalid channelRequest

David Edmundson davidedmundson at kemper.freedesktop.org
Wed Aug 27 14:36:14 PDT 2014


Module: telepathy-qt
Branch: master
Commit: fee87738e85e338f61228e0474b8ead1a23c4453
URL:    http://cgit.freedesktop.org/telepathy/telepathy-qt/commit/?id=fee87738e85e338f61228e0474b8ead1a23c4453

Author: David Edmundson <kde at davidedmundson.co.uk>
Date:   Wed Aug 27 23:37:02 2014 +0200

Avoid trying to load invalid channelRequest

If there is no relevant channel-request properties in the supplied
handlerInfo we can assume the channelRequest is bogus and we should
avoid trying to load it.

https://bugs.freedesktop.org/show_bug.cgi?id=77986

---

 TelepathyQt/client-registrar.cpp |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/TelepathyQt/client-registrar.cpp b/TelepathyQt/client-registrar.cpp
index 6ed9932..64905aa 100644
--- a/TelepathyQt/client-registrar.cpp
+++ b/TelepathyQt/client-registrar.cpp
@@ -193,6 +193,12 @@ void ClientObserverAdaptor::ObserveChannels(const QDBusObjectPath &accountPath,
     ObjectImmutablePropertiesMap reqPropsMap = qdbus_cast<ObjectImmutablePropertiesMap>(
             observerInfo.value(QLatin1String("request-properties")));
     foreach (const QDBusObjectPath &reqPath, requestsSatisfied) {
+        //don't load the channelRequest objects in requestsSatisfied if the properties are not supplied with the handler info
+        //as the channelRequest is probably invalid
+        //this works around https://bugs.freedesktop.org/show_bug.cgi?id=77986
+        if (reqPropsMap.value(reqPath).isEmpty()) {
+            continue;
+        }
         ChannelRequestPtr channelRequest = ChannelRequest::create(invocation->acc,
                 reqPath.path(), reqPropsMap.value(reqPath));
         invocation->chanReqs.append(channelRequest);
@@ -435,6 +441,12 @@ void ClientHandlerAdaptor::HandleChannels(const QDBusObjectPath &accountPath,
     ObjectImmutablePropertiesMap reqPropsMap = qdbus_cast<ObjectImmutablePropertiesMap>(
     handlerInfo.value(QLatin1String("request-properties")));
     foreach (const QDBusObjectPath &reqPath, requestsSatisfied) {
+        //don't load the channelRequest objects in requestsSatisfied if the properties are not supplied with the handler info
+        //as the channelRequest is probably invalid
+        //this works around https://bugs.freedesktop.org/show_bug.cgi?id=77986
+        if (reqPropsMap.value(reqPath).isEmpty()) {
+            continue;
+        }
         ChannelRequestPtr channelRequest = ChannelRequest::create(invocation->acc,
                 reqPath.path(), reqPropsMap.value(reqPath));
         invocation->chanReqs.append(channelRequest);



More information about the telepathy-commits mailing list