/*
* ngIRCd -- The Next Generation IRC Daemon
- * Copyright (c)2001-2011 Alexander Barton (alex@barton.de) and Contributors.
+ * Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors.
*
* 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
set ? '+' : '-',
*mode_ptr);
x[0] = '\0';
- goto client_exit;
} else {
Log(LOG_DEBUG,
"Handling unknown mode \"%c%c\" from \"%s\" for \"%s\" ...",
strlcat(the_modes, x, sizeof(the_modes));
}
}
-client_exit:
/* Are there changed modes? */
if (the_modes[1]) {
- /* Remoce needless action modifier characters */
+ /* Remove needless action modifier characters */
len = strlen(the_modes) - 1;
if (the_modes[len] == '+' || the_modes[len] == '-')
the_modes[len] = '\0';
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;
mode_ptr++;
if (!*mode_ptr) {
/* Try next argument if there's any */
+ if (arg_arg < 0)
+ break;
if (arg_arg > mode_arg)
mode_arg = arg_arg;
else
Client_ID(Origin), Channel_Name(Channel));
break;
case 'k': /* Channel key */
+ if (mode_arg_count++ >= MAX_HNDL_MODES_ARG)
+ goto chan_exit;
if (!set) {
if (modeok)
x[0] = *mode_ptr;
}
break;
case 'l': /* Member limit */
+ if (mode_arg_count++ >= MAX_HNDL_MODES_ARG)
+ goto chan_exit;
if (!set) {
if (modeok)
x[0] = *mode_ptr;
/* --- Channel lists --- */
case 'I': /* Invite lists */
case 'b': /* Ban lists */
+ if (mode_arg_count++ >= MAX_HNDL_MODES_ARG)
+ goto chan_exit;
if (arg_arg > mode_arg) {
/* modify list */
if (modeok) {
Client_ID(Origin),
set ? '+' : '-', *mode_ptr);
x[0] = '\0';
- goto chan_exit;
} else {
Log(LOG_DEBUG,
"Handling unknown mode \"%c%c\" from \"%s\" on %s ...",