Skip to content

Commit

Permalink
Check before dereferencing dnsc res.Answer (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
moh53n authored Jul 27, 2024
1 parent 9f3ad05 commit 9b135cb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ func (dnsc *DNSClient) PerformExternalAQuery(fqdn string, QType uint16) ([]dns.R
}
res, err := dnsc.Resolve(&msg, rdns.ClientInfo{})
dnsLock.Unlock()
if res == nil {
return nil, err
}
return res.Answer, err
}

Expand Down

0 comments on commit 9b135cb

Please sign in to comment.