From ac4696a507c41bd04e1557841233449172a0bd50 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 18 Nov 2021 09:44:33 +0100 Subject: [PATCH] Disallow empty string for nick --- downstream.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/downstream.go b/downstream.go index 5233863..142dad9 100644 --- a/downstream.go +++ b/downstream.go @@ -653,7 +653,7 @@ func (dc *downstreamConn) handleMessageUnregistered(ctx context.Context, msg *ir if err := parseMessageParams(msg, &nick); err != nil { return err } - if strings.ContainsAny(nick, illegalNickChars) { + if nick == "" || strings.ContainsAny(nick, illegalNickChars) { return ircError{&irc.Message{ Command: irc.ERR_ERRONEUSNICKNAME, Params: []string{dc.nick, nick, "contains illegal characters"}, @@ -1492,7 +1492,7 @@ func (dc *downstreamConn) handleMessageRegistered(ctx context.Context, msg *irc. } } - if strings.ContainsAny(nick, illegalNickChars) { + if nick == "" || strings.ContainsAny(nick, illegalNickChars) { return ircError{&irc.Message{ Command: irc.ERR_ERRONEUSNICKNAME, Params: []string{dc.nick, rawNick, "contains illegal characters"},