[Telepathy-commits] [telepathy-glib/master] Check that TargetID is a string if supplied

Will Thompson will.thompson at collabora.co.uk
Thu Sep 11 16:07:23 PDT 2008


---
 telepathy-glib/base-connection.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/telepathy-glib/base-connection.c b/telepathy-glib/base-connection.c
index e79fb43..eccfc91 100644
--- a/telepathy-glib/base-connection.c
+++ b/telepathy-glib/base-connection.c
@@ -2512,6 +2512,15 @@ conn_requests_check_basic_properties (TpBaseConnection *self,
   target_id = tp_asv_get_string (requested_properties,
       TP_IFACE_CHANNEL ".TargetID");
 
+  /* Allow TargetID to be missing, but not to be otherwise broken */
+  if (target_id == NULL && tp_asv_lookup (requested_properties,
+          TP_IFACE_CHANNEL ".TargetID") != NULL)
+    {
+      e.message = "TargetID must be a string";
+      dbus_g_method_return_error (context, &e);
+      return;
+    }
+
   /* FIXME: when InitiatorHandle, InitiatorID and Requested are officially
    * supported, if the request has any of them, raise an error */
 
-- 
1.5.6.5




More information about the Telepathy-commits mailing list