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,11 +538,14 @@ 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
if b.netMap != nil {
visible = make([]*ipnstate.TKAPeer, len(b.netMap.Peers))
for i, p := range b.netMap.Peers { for i, p := range b.netMap.Peers {
s := tkaStateFromPeer(p) s := tkaStateFromPeer(p)
visible[i] = &s visible[i] = &s
} }
}
stateID1, _ := b.tka.authority.StateIDs() stateID1, _ := b.tka.authority.StateIDs()

Loading…
Cancel
Save