From 69081851aca7191dfa56860ddf02b97aed4b72ba Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Tue, 31 Jul 2007 18:56:13 +0000 Subject: SECURITY: Fixed a severe bug in handling JOIN commands, which could cause the server to crash. Thanks to Sebastian Vesper, . --- src/ngircd/irc-channel.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ngircd/irc-channel.c b/src/ngircd/irc-channel.c index 7b92c2b0..03204d65 100644 --- a/src/ngircd/irc-channel.c +++ b/src/ngircd/irc-channel.c @@ -14,7 +14,7 @@ #include "portab.h" -static char UNUSED id[] = "$Id: irc-channel.c,v 1.39 2006/12/07 17:57:20 fw Exp $"; +static char UNUSED id[] = "$Id: irc-channel.c,v 1.40 2007/07/31 18:56:14 alex Exp $"; #include "imp.h" #include @@ -52,7 +52,9 @@ IRC_JOIN( CLIENT *Client, REQUEST *Req ) assert( Req != NULL ); /* Bad number of arguments? */ - if(( Req->argc > 2 )) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command ); + if (Req->argc < 1 || Req->argc > 2) + return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, + Client_ID(Client), Req->command); /* Who is the sender? */ if( Client_Type( Client ) == CLIENT_SERVER ) target = Client_Search( Req->prefix ); -- cgit 1.4.1