From 1ca8cd5276b484ac5dae354f076b06abd70a28cd Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Thu, 17 Mar 2016 23:12:43 -0500 Subject: [PATCH] parse: ensure that aliases have a sufficient number of parameters before trying to process them --- ircd/parse.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ircd/parse.c b/ircd/parse.c index b1e57bff..6e4189f9 100644 --- a/ircd/parse.c +++ b/ircd/parse.c @@ -146,6 +146,15 @@ parse(struct Client *client_p, char *pbuffer, char *bufend) struct alias_entry *aptr = rb_dictionary_retrieve(alias_dict, msgbuf.cmd); if (aptr != NULL) { + if (msgbuf.n_para < 2) + { + sendto_one(client_p, form_str(ERR_NEEDMOREPARAMS), + me.name, + EmptyString(client_p->name) ? "*" : client_p->name, + msgbuf.cmd); + return; + } + do_alias(aptr, client_p, reconstruct_parv(msgbuf.n_para - 1, msgbuf.para + 1)); return; }