mirror of
https://github.com/syncthing/syncthing.git
synced 2026-06-14 03:36:18 -04:00
When cap(permanentRelays) >= len(permanentRelays) + len(knownRelays), append(permanentRelays, knownRelays...) returns a slice of the array underlying permanentRelays. The subsequent rand.Shuffle then mixes the permanent and known relays. Sequential requests may cause strelaypoolsrv to forget its permanent relays. Worse, concurrent requests may cause shuffling of the same slice on multiple processors concurrently. Co-authored-by: greatroar <@>