m_dline: Abort early if host isn't an IP address

This commit is contained in:
Ed Kellett 2020-07-26 17:45:49 +01:00
parent 9ea60637cd
commit bf493a3410
No known key found for this signature in database
GPG key ID: CB9986DEF342FABC

View file

@ -103,6 +103,13 @@ mo_dline(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source
return; return;
} }
int ty = parse_netmask_strict(dlhost, NULL, NULL);
if (ty != HM_IPV4 && ty != HM_IPV6)
{
sendto_one_notice(source_p, ":Invalid D-Line");
return;
}
if(parc >= loc + 2 && !irccmp(parv[loc], "ON")) if(parc >= loc + 2 && !irccmp(parv[loc], "ON"))
{ {
if(!IsOperRemoteBan(source_p)) if(!IsOperRemoteBan(source_p))