soc.2009.telepathy: f62d3a07: Added parameter checks to telepathy_chan...

sttwister at gmail.com sttwister at gmail.com
Thu Oct 15 15:55:43 EDT 2009


-----------------------------------------------------------------
Revision: f62d3a07e678e00635dfb1b01fa2118cb0591cd0
Ancestor: dc84965ebfb80c76985b61eddcd91ec01c1043bb
Author: sttwister at gmail.com
Date: 2009-10-14T17:48:04
Branch: im.pidgin.soc.2009.telepathy
URL: http://d.pidgin.im/viewmtn/revision/info/f62d3a07e678e00635dfb1b01fa2118cb0591cd0

Modified files:
        libpurple/protocols/telepathy/telepathy_channel_list.c

ChangeLog: 

Added parameter checks to telepathy_channel_list.c

-------------- next part --------------
============================================================
--- libpurple/protocols/telepathy/telepathy_channel_list.c	e5bd6f75d2fa12a96876dc15df0f4be3052252c4
+++ libpurple/protocols/telepathy/telepathy_channel_list.c	2a2d4cc3564f96f938028b52ddd1865fe792d1ab
@@ -30,6 +30,8 @@ destroy_group(PrplTpGroup *tp_group)
 void
 destroy_group(PrplTpGroup *tp_group)
 {
+	g_return_if_fail(tp_group != NULL);
+
 	g_free(tp_group);	
 }
 
@@ -70,8 +72,12 @@ request_authorization_auth_cb (gpointer 
 request_authorization_auth_cb (gpointer user_data)
 {
 	PrplTpAuthorizationRequest *request = user_data;
-	GArray *arr = g_array_new(FALSE, FALSE, sizeof(guint));
+	GArray *arr;
 
+	g_return_if_fail(user_data != NULL);
+
+	arr = g_array_new(FALSE, FALSE, sizeof(guint));
+
 	purple_debug_info("telepathy", "Accepting request from %u\n", request->handle);
 
 	/* We must add the contact to the publish list */
@@ -105,8 +111,12 @@ request_authorization_deny_cb (gpointer 
 request_authorization_deny_cb (gpointer user_data)
 {
 	PrplTpAuthorizationRequest *request = user_data;
-	GArray *arr = g_array_new(FALSE, FALSE, sizeof(guint));
+	GArray *arr;
 
+	g_return_if_fail(user_data != NULL);
+
+	arr = g_array_new(FALSE, FALSE, sizeof(guint));
+
 	purple_debug_info("telepathy", "Denying request from %u\n", request->handle);
 
 	/* By removing the handle from the channel's local-pending,
@@ -136,6 +146,8 @@ request_authorization_cb (TpConnection *
 	PrplTpAuthorizationRequest *data = user_data;
 	int i;
 
+	g_return_if_fail(user_data != NULL);
+
 	if (error != NULL)
 	{
 		purple_debug_error("telepathy", "Error geting contact for"
@@ -185,6 +197,8 @@ members_changed_cb (TpChannel *proxy,
 	purple_debug_info("telepathy", "Members changed for %s! (Reason: %u) (Message: %s)\n",
 			tp_channel_get_identifier(proxy), arg_Reason, arg_Message);
 
+	g_return_if_fail(user_data != NULL);
+
 	if (arg_Added->len > 0)
 	{
 		purple_debug_info("telepathy", "  %u added\n",
@@ -243,6 +257,8 @@ get_local_pending_members_with_info_cb (
 	PrplTpConnection *data = user_data;
 	int i;
 
+	g_return_if_fail(user_data != NULL);
+
 	if (error != NULL)
 	{
 		purple_debug_error("telepathy", "GetLocalPending error: %s\n",
@@ -320,6 +336,9 @@ handle_list_channel (TpChannel *channel,
 
 	GError *error = NULL;
 
+	g_return_if_fail(channel != NULL);
+	g_return_if_fail(data != NULL);
+
 	handle = tp_channel_get_handle(channel, &handle_type);
 
 	members = tp_channel_group_get_members(channel);


More information about the Commits mailing list