From: Zoot Date: Sun, 29 Feb 2004 08:07:37 +0000 (+0000) Subject: Limit mode parameter count. X-Git-Tag: v1.4.0-rc1~262 X-Git-Url: http://git.pk910.de/?a=commitdiff_plain;h=b6649be61b64335b689e6d93f46bbc04d9e6bd87;p=srvx.git Limit mode parameter count. Restrict the number of mode parameters sent by the P10 protocol backend to MAXMODEPARAMS. git-archimport-id: srvx@srvx.net--2004-srvx/srvx--devo--1.3--patch-14 --- diff --git a/src/proto-p10.c b/src/proto-p10.c index 5aabfc5..b96e115 100644 --- a/src/proto-p10.c +++ b/src/proto-p10.c @@ -2087,7 +2087,8 @@ static void mod_chanmode_append(struct chanmode_buffer *buf, char ch, const char *arg) { size_t arg_len = strlen(arg); - if (buf->modes_used + buf->args_used + buf->chname_len + arg_len > 450) { + if (buf->modes_used > (MAXMODEPARAMS) || + buf->modes_used + buf->args_used + buf->chname_len + arg_len > 450) { memcpy(buf->modes + buf->modes_used, buf->args, buf->args_used); buf->modes[buf->modes_used + buf->args_used] = '\0'; irc_mode((buf->is_chanop ? buf->actor : NULL), buf->channel, buf->modes);