From 35fdd100a6c9e9ab362980d22e140ea18b793a6d Mon Sep 17 00:00:00 2001 From: Michael Poole Date: Thu, 31 May 2012 22:39:43 -0400 Subject: [PATCH] Reject G-line masks like + (with no target). Fixes SF#2965021. --- ChangeLog | 6 ++++++ ircd/m_gline.c | 8 ++++++++ 2 files changed, 14 insertions(+) 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; -- 2.20.1