From b9a7173ab510c2e66b40636e55f2e9cb5b1c7d49 Mon Sep 17 00:00:00 2001 From: Ed Kellett Date: Tue, 13 Jul 2021 15:40:34 +0100 Subject: [PATCH] chmode: stop processing when too many modes --- ircd/chmode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ircd/chmode.c b/ircd/chmode.c index 65d14524..d6d9141a 100644 --- a/ircd/chmode.c +++ b/ircd/chmode.c @@ -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)