dline,kline: Avoid breaking the protocol with bad bans.

This commit is contained in:
Jilles Tjoelker 2011-06-25 11:34:34 +02:00
parent b5d9427a78
commit 2b843a5bdd
2 changed files with 14 additions and 1 deletions

View 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))

View 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;
}