From 7d16af8d95f5eb496d1db22d0cd6cdbb18bed3e3 Mon Sep 17 00:00:00 2001 From: Fran Bull Date: Tue, 10 Sep 2024 13:20:06 -0700 Subject: [PATCH] cmd/natc: fix nil pointer Fixes #13432 Signed-off-by: Fran Bull --- cmd/natc/natc.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/natc/natc.go b/cmd/natc/natc.go index 41166fd4a..df458755c 100644 --- a/cmd/natc/natc.go +++ b/cmd/natc/natc.go @@ -489,6 +489,9 @@ type perPeerState struct { func (ps *perPeerState) domainForIP(ip netip.Addr) (_ string, ok bool) { ps.mu.Lock() defer ps.mu.Unlock() + if ps.addrToDomain == nil { + return "", false + } return ps.addrToDomain.Lookup(ip) }