Commit 8b2ff6c3 authored by Chris O'Haver's avatar Chris O'Haver Committed by GitHub

make copies of RRs before returning them (#4409)

Signed-off-by: default avatarChris O'Haver <cohaver@infoblox.com>
parent 95622f4c
......@@ -171,7 +171,12 @@ func (z *Zone) Lookup(ctx context.Context, state request.Request, qname string)
return z.externalLookup(ctx, state, elem, rrs)
}
rrs := elem.Type(qtype)
treeRRs := elem.Type(qtype)
// make a copy of the element RRs to prevent response writers from mutating the tree
rrs := make([]dns.RR, len(treeRRs))
for i, rr := range treeRRs {
rrs[i] = dns.Copy(rr)
}
// NODATA
if len(rrs) == 0 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment