chmode: stop processing when too many modes

This commit is contained in:
Ed Kellett 2021-07-13 15:40:34 +01:00
parent c7496b6fb7
commit b9a7173ab5

View file

@ -1360,13 +1360,13 @@ set_channel_mode(struct Client *client_p, struct Client *source_p,
char mode;
};
static struct modeset modesets[MAXPARA];
static struct modeset modesets[MAXMODEPARAMS + MAXMODES_SIMPLE];
struct modeset *ms = modesets, *mend;
char canon_op = '\0';
mbuf = modebuf;
for (ml = parv[0]; *ml != 0; ml++)
for (ml = parv[0]; *ml != 0 && ms - modesets < ARRAY_SIZE(modesets); ml++)
{
c = *ml;
switch (c)