X-Git-Url: http://git.pk910.de/?p=ircu2.10.12-pk.git;a=blobdiff_plain;f=ircd%2Fgline.c;h=9c3d2970e24df6a078e4c976cb94c64a2b7d8d36;hp=4f95526448498e3b968574027a68d3e2ffff953f;hb=72b0c799c590095ad78de705f36e9553bd41fa67;hpb=384fa2237ccf0348190d655a6ea4cb8131d05354 diff --git a/ircd/gline.c b/ircd/gline.c index 4f95526..9c3d297 100644 --- a/ircd/gline.c +++ b/ircd/gline.c @@ -24,6 +24,7 @@ #include "config.h" #include "gline.h" +#include "channel.h" #include "client.h" #include "ircd.h" #include "ircd_alloc.h" @@ -448,13 +449,21 @@ gline_add(struct Client *cptr, struct Client *sptr, char *userhost, if (*userhost == '#' || *userhost == '&') { if ((flags & GLINE_LOCAL) && !HasPriv(sptr, PRIV_LOCAL_BADCHAN)) return send_reply(sptr, ERR_NOPRIVILEGES); + /* Allow maximum channel name length, plus margin for wildcards. */ + if (strlen(userhost+1) >= CHANNELLEN + 6) + return send_reply(sptr, ERR_LONGMASK); flags |= GLINE_BADCHAN; user = userhost; host = NULL; } else if (*userhost == '$') { switch (userhost[1]) { - case 'R': flags |= GLINE_REALNAME; break; + case 'R': + /* Allow REALLEN for the real name, plus margin for wildcards. */ + if (strlen(userhost+2) >= REALLEN + 6) + return send_reply(sptr, ERR_LONGMASK); + flags |= GLINE_REALNAME; + break; default: /* uh, what to do here? */ /* The answer, my dear Watson, is we throw a protocol_violation()