diff options
| author | Alexander Barton <alex@barton.de> | 2007-07-31 18:56:13 +0000 |
|---|---|---|
| committer | Alexander Barton <alex@barton.de> | 2007-07-31 18:56:13 +0000 |
| commit | 69081851aca7191dfa56860ddf02b97aed4b72ba (patch) | |
| tree | ffe36d9135b41970a3ac02f9c241afd4736c0b69 /src | |
| parent | efcca62a35000002af541c2c73cc7c42bfd0fb12 (diff) | |
| download | ngircd-69081851aca7191dfa56860ddf02b97aed4b72ba.tar.gz ngircd-69081851aca7191dfa56860ddf02b97aed4b72ba.zip | |
SECURITY: Fixed a severe bug in handling JOIN commands, which could
cause the server to crash. Thanks to Sebastian Vesper, <net@veoson.net>.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ngircd/irc-channel.c | 6 |
1 files changed, 4 insertions, 2 deletions
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 <assert.h> @@ -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 ); |