ipn/ipnlocal: fix a nil pointer dereference when serving /localapi/v0/tka/status

Fixes #13330

Signed-off-by: Nick Khyl <nickk@tailscale.com>
dependabot/npm_and_yarn/cmd/tsconnect/micromatch-4.0.8
Nick Khyl 3 months ago committed by Nick Khyl
parent 3d9e3a17fa
commit 2f2aeaeaeb

@ -538,10 +538,13 @@ func (b *LocalBackend) NetworkLockStatus() *ipnstate.NetworkLockStatus {
filtered[i] = b.tka.filtered[i].Clone() filtered[i] = b.tka.filtered[i].Clone()
} }
visible := make([]*ipnstate.TKAPeer, len(b.netMap.Peers)) var visible []*ipnstate.TKAPeer
for i, p := range b.netMap.Peers { if b.netMap != nil {
s := tkaStateFromPeer(p) visible = make([]*ipnstate.TKAPeer, len(b.netMap.Peers))
visible[i] = &s for i, p := range b.netMap.Peers {
s := tkaStateFromPeer(p)
visible[i] = &s
}
} }
stateID1, _ := b.tka.authority.StateIDs() stateID1, _ := b.tka.authority.StateIDs()

Loading…
Cancel
Save