commit - 1fa2af5b3a95cad24c3e8b56ee7e57aa5084bfdb
commit + 98493077a2d044aa08ee5cb4bd7054579e30fb57
blob - 4bcb6aff8ce295ce9c39076cca0b9e0929e0aa2e
blob + b894dbc7beffef50138c2a96ea9afb80fdd2d4cd
--- src/ngircd/defines.h
+++ src/ngircd/defines.h
/*
* ngIRCd -- The Next Generation IRC Daemon
- * Copyright (c)2001-2010 Alexander Barton (alex@barton.de)
+ * Copyright (c)2001-2012 Alexander Barton (alex@barton.de)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#define MAX_WHOWAS 64 /* Max. number of WHOWAS items */
#define DEFAULT_WHOWAS 5 /* default count for WHOWAS command */
+#define MAX_CMODES_ARG 5 /* Max. number of channel modes with
+ * arguments per MODE command */
+
#define CONNECTION_POOL 100 /* Size of default connection pool */
#define CLIENT_ID_LEN 64 /* Max. length of an IRC ID; see RFC
blob - 01f87621a6d670df9b7973528d3892b3672caee4
blob + 9afe90780188ba1941874d9796427323af852816
--- src/ngircd/irc-mode.c
+++ src/ngircd/irc-mode.c
char the_modes[COMMAND_LEN], the_args[COMMAND_LEN], x[2],
argadd[CLIENT_PASS_LEN], *mode_ptr;
bool connected, set, skiponce, retval, onchannel, modeok, use_servermode;
- int mode_arg, arg_arg;
+ int mode_arg, arg_arg, mode_arg_count = 0;
CLIENT *client;
long l;
size_t len;
Client_ID(Origin), Channel_Name(Channel));
break;
case 'k': /* Channel key */
+ if (mode_arg_count++ >= MAX_CMODES_ARG)
+ break;
if (!set) {
if (modeok)
x[0] = *mode_ptr;
}
break;
case 'l': /* Member limit */
+ if (mode_arg_count++ >= MAX_CMODES_ARG)
+ break;
if (!set) {
if (modeok)
x[0] = *mode_ptr;
/* --- Channel lists --- */
case 'I': /* Invite lists */
case 'b': /* Ban lists */
+ if (mode_arg_count++ >= MAX_CMODES_ARG)
+ break;
if (arg_arg > mode_arg) {
/* modify list */
if (modeok) {