mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 15:33:54 +01:00
dline,kline: Avoid breaking the protocol with bad bans.
This commit is contained in:
parent
b5d9427a78
commit
2b843a5bdd
2 changed files with 14 additions and 1 deletions
|
@ -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))
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue