changeset 32043:9449f70762e7

silc: Avoid calling strstr(NULL, ...) if chname isn't set.
author Paul Aurich <paul@darkrain42.org>
date Wed, 11 May 2011 04:29:56 +0000
parents f762bcb55249
children 98945afd4c44
files libpurple/protocols/silc/chat.c
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/silc/chat.c	Wed May 11 04:20:12 2011 +0000
+++ b/libpurple/protocols/silc/chat.c	Wed May 11 04:29:56 2011 +0000
@@ -894,9 +894,10 @@
 
 	if (components)
 		chname = g_hash_table_lookup(components, "channel");
-	if (chname)
-		channel = silc_client_get_channel(sg->client, sg->conn,
-						  (char *)chname);
+	if (!chname)
+		return NULL;
+	channel = silc_client_get_channel(sg->client, sg->conn,
+					  (char *)chname);
 	if (channel) {
 		chu = silc_client_on_channel(channel, conn->local_entry);
 		if (chu)