[Telepathy-commits] [telepathy-glib/master] TpBaseConnection: in CreateChannel, check that handle repo exists before using it

Simon McVittie simon.mcvittie at collabora.co.uk
Thu Sep 25 10:13:06 PDT 2008


This fixes a crash if a channel with an entirely unsupported handle type is
requested. The change is actually in utility code, so EnsureChannel will
also benefit from this once we implement it.
---
 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 b6c9ee7..380c93d 100644
--- a/telepathy-glib/base-connection.c
+++ b/telepathy-glib/base-connection.c
@@ -2828,6 +2828,15 @@ conn_requests_requestotron_validate_handle (TpBaseConnection *self,
 
       handles = tp_base_connection_get_handles (self, target_handle_type);
 
+      if (handles == NULL)
+        {
+          GError e = { TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
+              "Handle type not supported by this connection manager" };
+
+          dbus_g_method_return_error (context, &e);
+          return;
+        }
+
       if (target_handle == 0)
         {
           /* Turn TargetID into TargetHandle */
-- 
1.5.6.5




More information about the Telepathy-commits mailing list