Reject G-line masks like + (with no target). Fixes SF#2965021.
[ircu2.10.12-pk.git] / ircd / m_gline.c
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;