Pull request 2095: fix nil deref
Squashed commit of the following: commit 74089af1bb05892ac5c1e4dfefde6256e1b55c02 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Dec 5 20:50:12 2023 +0300 dnsforward: fix nil deref
This commit is contained in:
parent
99af7f46de
commit
a0ec0b2b57
|
@ -247,7 +247,6 @@ func NewServer(p DNSCreateParams) (s *Server, err error) {
|
||||||
privateNets: p.PrivateNets,
|
privateNets: p.PrivateNets,
|
||||||
// TODO(e.burkov): Use some case-insensitive string comparison.
|
// TODO(e.burkov): Use some case-insensitive string comparison.
|
||||||
localDomainSuffix: strings.ToLower(localDomainSuffix),
|
localDomainSuffix: strings.ToLower(localDomainSuffix),
|
||||||
etcHosts: p.EtcHosts,
|
|
||||||
recDetector: newRecursionDetector(recursionTTL, cachedRecurrentReqNum),
|
recDetector: newRecursionDetector(recursionTTL, cachedRecurrentReqNum),
|
||||||
clientIDCache: cache.New(cache.Config{
|
clientIDCache: cache.New(cache.Config{
|
||||||
EnableLRU: true,
|
EnableLRU: true,
|
||||||
|
@ -258,6 +257,9 @@ func NewServer(p DNSCreateParams) (s *Server, err error) {
|
||||||
ServePlainDNS: true,
|
ServePlainDNS: true,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
if p.EtcHosts != nil {
|
||||||
|
s.etcHosts = p.EtcHosts
|
||||||
|
}
|
||||||
|
|
||||||
s.sysResolvers, err = sysresolv.NewSystemResolvers(nil, defaultPlainDNSPort)
|
s.sysResolvers, err = sysresolv.NewSystemResolvers(nil, defaultPlainDNSPort)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue