don't dispatch D-Bus tube having an invalid ServiceName
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 21 Apr 2009 14:58:02 +0000 (15:58 +0100)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 21 Apr 2009 14:59:25 +0000 (15:59 +0100)
src/empathy-tube-dispatch.c

index b1e7bce6d18d13c3ec1ef4efc087b4393a25afb6..63b31b2b6f1e190b624ea963cbe443d190d5d59b 100644 (file)
@@ -167,9 +167,20 @@ empathy_tube_dispatch_constructed (GObject *object)
     }
   else if (!tp_strdiff (channel_type, EMP_IFACE_CHANNEL_TYPE_DBUS_TUBE))
     {
+      GError *error = NULL;
+
       type = TP_TUBE_TYPE_DBUS;
       service = tp_asv_get_string (properties,
         EMP_IFACE_CHANNEL_TYPE_DBUS_TUBE  ".ServiceName");
+
+      if (!tp_dbus_check_valid_bus_name (service, TP_DBUS_NAME_TYPE_WELL_KNOWN,
+            &error))
+        {
+          DEBUG ("Can't dispatch tube; invalid ServiceName %s: %s", service,
+              error->message);
+          g_error_free (error);
+          goto failed;
+        }
     }
   else
     {