[Telepathy-commits] [telepathy-gabble/master] gabble_private_tubes_factory_requestotron: check if ServiceName is valid

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Tue Feb 3 03:36:35 PST 2009


---
 src/private-tubes-factory.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/private-tubes-factory.c b/src/private-tubes-factory.c
index c866d5b..23ae9dd 100644
--- a/src/private-tubes-factory.c
+++ b/src/private-tubes-factory.c
@@ -1207,6 +1207,7 @@ gabble_private_tubes_factory_requestotron (GabblePrivateTubesFactory *self,
   else if (! tp_strdiff (channel_type, GABBLE_IFACE_CHANNEL_TYPE_DBUS_TUBE))
     {
       const gchar *service;
+      GError *err = NULL;
 
       if (tp_channel_manager_asv_has_unknown_properties (request_properties,
               tubes_channel_fixed_properties,
@@ -1224,6 +1225,15 @@ gabble_private_tubes_factory_requestotron (GabblePrivateTubesFactory *self,
               GABBLE_IFACE_CHANNEL_TYPE_DBUS_TUBE ".ServiceName");
           goto error;
         }
+
+      if (!tp_dbus_check_valid_bus_name (service, TP_DBUS_NAME_TYPE_WELL_KNOWN,
+            &err))
+        {
+          g_set_error (&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
+              "Invalid ServiceName: %s", err->message);
+          g_error_free (err);
+          goto error;
+        }
     }
 
   /* validity already checked by TpBaseConnection */
-- 
1.5.6.5




More information about the telepathy-commits mailing list