From 5f47deeb94b736ce8092acb35bbd430ea36e5a10 Mon Sep 17 00:00:00 2001 From: Andreas Neue Date: Sat, 6 Aug 2016 20:16:01 +0200 Subject: [PATCH] Dont allow channel names not beginning with '#' --- handlers.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/handlers.go b/handlers.go index aac7cc0..4331657 100644 --- a/handlers.go +++ b/handlers.go @@ -71,6 +71,10 @@ func handleCmdJoin(sv *Server, msg *irc.Message) { first := false clid := strings.ToLower(msg.Pre) chid := strings.ToLower(msg.Args[0]) + if !strings.HasPrefix(chid, "#") { + sv.sendReply(msg.Pre, ERR_NOSUCHCHANNEL, msg.Args[0], "No such channel") + return + } if _, exists := sv.chUsers[chid]; !exists { sv.chUsers[chid] = make(map[string]string) sv.chTopics[chid] = ""