about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlexander Barton <alex@barton.de>2010-12-24 12:48:03 +0100
committerAlexander Barton <alex@barton.de>2010-12-24 12:48:03 +0100
commit36d4f6c6015a0c93a2785e135d43dc8f23797b38 (patch)
tree6f8910c01406fb8f24c0b926065be0d4fa16945f
parent186b14f332810dd8e828c4f07ec89efcc298d4b0 (diff)
downloadngircd-36d4f6c6015a0c93a2785e135d43dc8f23797b38.tar.gz
ngircd-36d4f6c6015a0c93a2785e135d43dc8f23797b38.zip
Don't assert() when serching a client for an invalid server token
This is only relevant when a trusted server on a server-server link
sends invalid commands.
-rw-r--r--src/ngircd/client.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/ngircd/client.c b/src/ngircd/client.c
index 739c5ea5..ecd1a7c5 100644
--- a/src/ngircd/client.c
+++ b/src/ngircd/client.c
@@ -553,17 +553,19 @@ Client_Search( const char *Nick )
 } /* Client_Search */
 
 
+/**
+ * Get client structure ("introducer") identfied by a server token.
+ * @return CLIENT structure or NULL if none could be found.
+ */
 GLOBAL CLIENT *
 Client_GetFromToken( CLIENT *Client, int Token )
 {
-	/* Client-Struktur, die den entsprechenden Introducer (=Client)
-	 * und das gegebene Token hat, liefern. Wird keine gefunden,
-	 * so wird NULL geliefert. */
-
 	CLIENT *c;
 
 	assert( Client != NULL );
-	assert( Token > 0 );
+
+	if (!Token)
+		return NULL;
 
 	c = My_Clients;
 	while (c) {