pidgin: a8027dd0: Add assertions to purple_account_add_bud...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Fri Aug 28 23:00:51 EDT 2009


-----------------------------------------------------------------
Revision: a8027dd0843d6009e71c1926a080aad4f2078acf
Ancestor: 155eaff66198bb519898da8e7071925567efc279
Author: darkrain42 at pidgin.im
Date: 2009-08-29T02:32:16
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/a8027dd0843d6009e71c1926a080aad4f2078acf

Modified files:
        libpurple/account.c

ChangeLog: 

Add assertions to purple_account_add_buddy; a NULL buddy is very bad. Refs #10115.

-------------- next part --------------
============================================================
--- libpurple/account.c	82931533b8174bb99ab4d62337d1072bf3af2d8c
+++ libpurple/account.c	8fb2f5226f1ff8bd7cec07890e8a3a85cb99b2e2
@@ -2290,9 +2290,13 @@ purple_account_add_buddy(PurpleAccount *
 purple_account_add_buddy(PurpleAccount *account, PurpleBuddy *buddy)
 {
 	PurplePluginProtocolInfo *prpl_info = NULL;
-	PurpleConnection *gc = purple_account_get_connection(account);
+	PurpleConnection *gc;
 	PurplePlugin *prpl = NULL;
 
+	g_return_if_fail(account != NULL);
+	g_return_if_fail(buddy != NULL);
+
+	gc = purple_account_get_connection(account);
 	if (gc != NULL)
 	        prpl = purple_connection_get_prpl(gc);
 


More information about the Commits mailing list