Reject G-line masks like + (with no target). Fixes SF#2965021.
authorMichael Poole <mdpoole@troilus.org>
Fri, 1 Jun 2012 02:39:43 +0000 (22:39 -0400)
committerMichael Poole <mdpoole@troilus.org>
Fri, 1 Jun 2012 02:41:35 +0000 (22:41 -0400)
ChangeLog
ircd/m_gline.c

index d955283cfd77552d755aa180c9cf3d7bc0fc2d1a..840e3dba42764a737961974ea2ed436030fce378 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-05-31  Michael Poole <mdpoole@troilus.org>
+
+       * 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 <mdpoole@troilus.org>
 
        * include/channel.h (infochanmodes): Add +d channel mode.
index 18bc31d46fb5a7d98ab55ef1c90697c1c0472e0f..9b6f66164fdcca12c755de0aeec95aac6fbb523c 100644 (file)
@@ -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;