diff --git a/client.go b/client.go index fcba652..dddc5dd 100644 --- a/client.go +++ b/client.go @@ -124,7 +124,14 @@ func (b *Barnard) OnConnect(e *gumble.ConnectEvent) { b.UiTree.Rebuild() b.Ui.Refresh() - for _, u := range b.Client.Users { + var users []*gumble.User + b.Client.Do(func() { + users = make([]*gumble.User, 0, len(b.Client.Users)) + for _, u := range b.Client.Users { + users = append(users, u) + } + }) + for _, u := range users { b.UserConfig.UpdateUser(u) b.rememberUserChannel(u) } diff --git a/fix.txt b/fix.txt index 0f17c64..5197116 100644 --- a/fix.txt +++ b/fix.txt @@ -272,7 +272,7 @@ Priority 3: configuration, UI, and binding hardening seconds for the protocol, creating a huge ban duration. Reject negative durations and validate mask/address before sending. -36. Admin, tree, and client code read mutable maps outside Client.Do +[x] 36. Admin, tree, and client code read mutable maps outside Client.Do Files: admin.go, ui_tree.go, client.go UI code ranges Client.Users, Channels, Channel.Users, and Children while network handlers mutate them. This overlaps issue 2 but must be fixed on