Module: ngircd.git Branch: master Commit: 36d4f6c6015a0c93a2785e135d43dc8f23797b38 URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=36d4f...
Author: Alexander Barton alex@barton.de Date: Fri Dec 24 12:48:03 2010 +0100
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.
---
src/ngircd/client.c | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/ngircd/client.c b/src/ngircd/client.c index 739c5ea..ecd1a7c 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) {