]> jfr.im git - solanum.git/commitdiff
dline,kline: Avoid breaking the protocol with bad bans.
authorJilles Tjoelker <redacted>
Sat, 25 Jun 2011 09:34:34 +0000 (11:34 +0200)
committerJilles Tjoelker <redacted>
Sat, 25 Jun 2011 09:34:34 +0000 (11:34 +0200)
modules/m_dline.c
modules/m_kline.c

index bb928ac4c92a02686dccfdaf6e6bf15b1c7632bd..f3a40cea3e6935a8a0eacb5ad2719c53bf936912 100644 (file)
@@ -96,9 +96,15 @@ mo_dline(struct Client *client_p, struct Client *source_p, int parc, const char
 
        dlhost = parv[loc];
        rb_strlcpy(cidr_form_host, dlhost, sizeof(cidr_form_host));
-
        loc++;
 
+       /* would break the protocol */
+       if (*dlhost == ':')
+       {
+               sendto_one_notice(source_p, ":Invalid D-Line");
+               return 0;
+       }
+
        if(parc >= loc + 2 && !irccmp(parv[loc], "ON"))
        {
                if(!IsOperRemoteBan(source_p))
index 89ba2353344abf36250841176cc4144a36addf53..373fdfbda2851d0d04a07a419f28346b8bb22feb 100644 (file)
@@ -669,6 +669,13 @@ find_user_host(struct Client *source_p, const char *userhost, char *luser, char
                rb_strlcpy(lhost, userhost, HOSTLEN + 1);
        }
 
+       /* would break the protocol */
+       if (*luser == ':' || *lhost == ':')
+       {
+               sendto_one_notice(source_p, ":Invalid K-Line");
+               return 0;
+       }
+
        return 1;
 }