From de7b4c8588f22ca8d938a7f22b18bdff255e3150 Mon Sep 17 00:00:00 2001 From: delthas Date: Thu, 21 May 2020 06:59:49 +0200 Subject: [PATCH] Fix a null access due to assigning nil to the member memberships map Even though the memberships map has type map[string]*memberships (with memberships being defined as []membership), the default value for that map should not be `nil` but a pointer to a nil slice. This fixes a segfault on some servers before user channel prefixes are sent. --- upstream.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upstream.go b/upstream.go index c16ca47..e386379 100644 --- a/upstream.go +++ b/upstream.go @@ -692,7 +692,7 @@ func (uc *upstreamConn) handleMessage(msg *irc.Message) error { if err != nil { return err } - ch.Members[msg.Prefix.Name] = nil + ch.Members[msg.Prefix.Name] = &memberships{} } chMsg := msg.Copy()