mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 08:14:18 -04:00
plugin/file: fix crash (#1301)
When z.Tree.Prev returns zero we should break out of this loop, not use elem as if nothing has happened. Can be triggered by sending edns0 to unsigned zone.
This commit is contained in:
@@ -235,7 +235,10 @@ func (z *Zone) Lookup(state request.Request, qname string) ([]dns.RR, []dns.RR,
|
||||
|
||||
ret := z.soa(do)
|
||||
if do {
|
||||
deny, _ := z.Tree.Prev(qname) // TODO(miek): *found* was not used here.
|
||||
deny, found := z.Tree.Prev(qname)
|
||||
if !found {
|
||||
goto Out
|
||||
}
|
||||
nsec := z.typeFromElem(deny, dns.TypeNSEC, do)
|
||||
ret = append(ret, nsec...)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user