plugin/transfer: Fix panic in CoreDNS transfer plugin caused by empty DNS record (#8207)

This PR fixes panic in CoreDNS transfer plugin caused by empty DNS record.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
Yong Tang
2026-07-09 10:21:45 -07:00
committed by GitHub
parent 2d106be341
commit ab318db7b4
2 changed files with 31 additions and 0 deletions

View File

@@ -128,6 +128,9 @@ func (t *Transfer) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Ms
batchSize := 0
var soa *dns.SOA
for records := range pchan {
if len(records) == 0 {
continue
}
if x, ok := records[0].(*dns.SOA); ok && soa == nil {
soa = x
}