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.
This commit is contained in:
delthas 2020-05-21 06:59:49 +02:00 committed by Simon Ser
parent c88700ef18
commit de7b4c8588
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48
1 changed files with 1 additions and 1 deletions

View File

@ -692,7 +692,7 @@ func (uc *upstreamConn) handleMessage(msg *irc.Message) error {
if err != nil { if err != nil {
return err return err
} }
ch.Members[msg.Prefix.Name] = nil ch.Members[msg.Prefix.Name] = &memberships{}
} }
chMsg := msg.Copy() chMsg := msg.Copy()