From bf493a34103c35bed8112cbf90bf3a49b85b40b1 Mon Sep 17 00:00:00 2001 From: Ed Kellett Date: Sun, 26 Jul 2020 17:45:49 +0100 Subject: [PATCH] m_dline: Abort early if host isn't an IP address --- modules/m_dline.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/m_dline.c b/modules/m_dline.c index e0766ac3..e6e18dd2 100644 --- a/modules/m_dline.c +++ b/modules/m_dline.c @@ -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))