]> jfr.im git - solanum.git/blobdiff - modules/m_dline.c
m_dline: Abort early if host isn't an IP address
[solanum.git] / modules / m_dline.c
index e0766ac3473045da5472a2437b153d028d69c7aa..e6e18dd2e363b968166ebcce64742e4fc5689f3a 100644 (file)
@@ -103,6 +103,13 @@ mo_dline(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source
                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(!IsOperRemoteBan(source_p))