Skip to content

Commit

Permalink
Fix nil pointer dereference for empty edns conifg
Browse files Browse the repository at this point in the history
  • Loading branch information
shawn1m committed Jan 9, 2021
1 parent 82d9039 commit 0dcc87f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/outbound/clients/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ type RemoteClient struct {

func NewClient(q *dns.Msg, u *common.DNSUpstream, resolver resolver.Resolver, ip string, cache *cache.Cache) *RemoteClient {
c := &RemoteClient{questionMessage: q.Copy(), dnsUpstream: u, dnsResolver: resolver, inboundIP: ip, cache: cache}
c.getEDNSClientSubnetIP()

if c.dnsUpstream.EDNSClientSubnet != nil {
c.getEDNSClientSubnetIP()
}

return c
}
Expand Down

0 comments on commit 0dcc87f

Please sign in to comment.