changeset 24370:5950e7a32c4f

merge of '12d71b833c7d3451c58c50e6dc621a88d678d474' and '42f888b4f8e15a19002abe6f40a5d89117ee59a7'
author Richard Laager <rlaager@wiktel.com>
date Fri, 14 Nov 2008 07:41:10 +0000
parents a3523b143f78 (current diff) f9503aa61fb4 (diff)
children b70fa8735b73
files
diffstat 8 files changed, 26 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/plugins/log_reader.c	Fri Nov 14 07:24:09 2008 +0000
+++ b/libpurple/plugins/log_reader.c	Fri Nov 14 07:41:10 2008 +0000
@@ -1971,7 +1971,7 @@
 	c = contents;
 	line = contents;
 
-	while (*c) {
+	while (c && *c) {
 		gboolean is_in_message = FALSE;
 
 		if (purple_str_has_prefix(line, QIP_LOG_IN_MESSAGE_ESC) ||
--- a/libpurple/protocols/qq/qq_network.c	Fri Nov 14 07:24:09 2008 +0000
+++ b/libpurple/protocols/qq/qq_network.c	Fri Nov 14 07:41:10 2008 +0000
@@ -461,9 +461,6 @@
 			conn->tcp_rxqueue = NULL;
 		}
 
-		if (pkt == NULL) {
-			continue;
-		}
 		/* packet_process may call disconnect and destory data like conn
 		 * do not call packet_process before jump,
 		 * break if packet_process return FALSE */
--- a/libpurple/protocols/simple/simple.c	Fri Nov 14 07:24:09 2008 +0000
+++ b/libpurple/protocols/simple/simple.c	Fri Nov 14 07:41:10 2008 +0000
@@ -1228,11 +1228,14 @@
 				if (purple_str_has_prefix(ssparts[i], "terminated"))
 				{
 					purple_debug_info("simple", "Subscription expired!");
-					g_free(b->dialog->ourtag);
-					g_free(b->dialog->theirtag);
-					g_free(b->dialog->callid);
-					g_free(b->dialog);
-					b->dialog = NULL;
+					if (b->dialog)
+					{
+						g_free(b->dialog->ourtag);
+						g_free(b->dialog->theirtag);
+						g_free(b->dialog->callid);
+						g_free(b->dialog);
+						b->dialog = NULL;
+					}
 
 					purple_prpl_got_user_status(sip->account, from, "offline", NULL);
 					break;
--- a/libpurple/server.c	Fri Nov 14 07:24:09 2008 +0000
+++ b/libpurple/server.c	Fri Nov 14 07:41:10 2008 +0000
@@ -259,7 +259,8 @@
 		purple_blist_server_alias_buddy(b, alias);
 
 		conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, b->name, account);
-		if(conv != NULL && alias != NULL && strcmp(alias, who))
+		if(conv != NULL && alias != NULL &&
+		   who != NULL && strcmp(alias, who))
 		{
 			char *escaped = g_markup_escape_text(who, -1);
 			char *escaped2 = g_markup_escape_text(alias, -1);
--- a/libpurple/util.c	Fri Nov 14 07:24:09 2008 +0000
+++ b/libpurple/util.c	Fri Nov 14 07:41:10 2008 +0000
@@ -984,6 +984,8 @@
 	gchar *tmp;
 	gchar *ret;
 
+	g_return_val_if_fail(opt != NULL, NULL);
+
 	if (!css_str)
 		return NULL;
 
@@ -2390,6 +2392,7 @@
 	gunichar c;
 	char *tag;
 
+	g_return_val_if_fail(str != NULL, NULL);
 	g_return_val_if_fail(x <= y, NULL);
 
 	if (x == y)
@@ -3440,6 +3443,9 @@
 	char *cmd;
 	GHashTable *params = NULL;
 	int len;
+
+	g_return_if_fail(uri != NULL);
+
 	if (!(tmp = strchr(uri, ':')) || tmp == uri) {
 		purple_debug_error("util", "Malformed protocol handler message - missing protocol.\n");
 		return;
@@ -4145,6 +4151,8 @@
 	const char *c, *domain;
 	static char *rfc822_specials = "()<>@,;:\\\"[]";
 
+	g_return_val_if_fail(address != NULL, FALSE);
+
 	/* first we validate the name portion (name@domain) (rfc822)*/
 	for (c = address;  *c;  c++) {
 		if (*c == '\"' && (c == address || *(c - 1) == '.' || *(c - 1) == '\"')) {
@@ -4193,6 +4201,9 @@
 {
 	int c, o1, o2, o3, o4;
 	char end;
+
+	g_return_val_if_fail(ip != NULL, FALSE);
+
 	c = sscanf(ip, "%d.%d.%d.%d%c", &o1, &o2, &o3, &o4, &end);
 	if (c != 4 || o1 < 0 || o1 > 255 || o2 < 0 || o2 > 255 || o3 < 0 || o3 > 255 || o4 < 0 || o4 > 255)
 		return FALSE;
--- a/libpurple/xmlnode.c	Fri Nov 14 07:24:09 2008 +0000
+++ b/libpurple/xmlnode.c	Fri Nov 14 07:41:10 2008 +0000
@@ -249,6 +249,7 @@
 	xmlnode *x;
 
 	g_return_val_if_fail(node != NULL, NULL);
+	g_return_val_if_fail(attr != NULL, NULL);
 
 	for(x = node->child; x; x = x->next) {
 		if(x->type == XMLNODE_TYPE_ATTRIB && !strcmp(attr, x->name)) {
@@ -265,6 +266,7 @@
 	xmlnode *x;
 
 	g_return_val_if_fail(node != NULL, NULL);
+	g_return_val_if_fail(attr != NULL, NULL);
 
 	for(x = node->child; x; x = x->next) {
 		if(x->type == XMLNODE_TYPE_ATTRIB &&
--- a/pidgin/gtkaccount.c	Fri Nov 14 07:24:09 2008 +0000
+++ b/pidgin/gtkaccount.c	Fri Nov 14 07:41:10 2008 +0000
@@ -472,7 +472,7 @@
 					 G_CALLBACK(screenname_changed_cb), dialog);
 
 	/* Do the user split thang */
-	if (dialog->plugin == NULL) /* Yeah right. */
+	if (dialog->prpl_info == NULL)
 		user_splits = NULL;
 	else
 		user_splits = dialog->prpl_info->user_splits;
--- a/pidgin/gtkblist.c	Fri Nov 14 07:24:09 2008 +0000
+++ b/pidgin/gtkblist.c	Fri Nov 14 07:41:10 2008 +0000
@@ -3344,7 +3344,7 @@
 			}
 		}
 
-		if (prpl_info->chat_info != NULL)
+		if (prpl_info && prpl_info->chat_info != NULL)
 			cur = prpl_info->chat_info(chat->account->gc);
 		else
 			cur = NULL;