From: Michael Poole Date: Fri, 1 Jun 2012 02:39:43 +0000 (-0400) Subject: Reject G-line masks like + (with no target). Fixes SF#2965021. X-Git-Url: http://git.pk910.de/?p=ircu2.10.12-pk.git;a=commitdiff_plain;h=35fdd100a6c9e9ab362980d22e140ea18b793a6d Reject G-line masks like + (with no target). Fixes SF#2965021. --- diff --git a/ChangeLog b/ChangeLog index d955283..840e3db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-05-31 Michael Poole + + * ircd/m_gline.c (ms_gline): If the mask was empty after removing + the command character(s), reject the command. + (mo_gline): Likewise. + 2012-05-31 Michael Poole * include/channel.h (infochanmodes): Add +d channel mode. diff --git a/ircd/m_gline.c b/ircd/m_gline.c index 18bc31d..9b6f661 100644 --- a/ircd/m_gline.c +++ b/ircd/m_gline.c @@ -167,6 +167,10 @@ ms_gline(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) break; } + /* Is there no mask left? */ + if (mask[0] == '\0') + return need_more_params(sptr, "GLINE"); + /* Now, let's figure out if it's a local or global G-line */ if (action == GLINE_LOCAL_ACTIVATE || action == GLINE_LOCAL_DEACTIVATE || (target[0] == '*' && target[1] == '\0')) @@ -477,6 +481,10 @@ mo_gline(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) break; } + /* Is there no mask left? */ + if (mask[0] == '\0') + return need_more_params(sptr, "GLINE"); + /* Now let's figure out which is the target server */ if (!target) /* no target, has to be me... */ acptr = &me;