mirror of
https://github.com/coredns/coredns.git
synced 2026-10-18 08:15:43 -04:00
plugin/dns64: Fixes a nil pointer dereference panic in dns64 during response (#8511)
This PR fixes a nil pointer dereference panic in dns64 during response, when the internal A-record upstream re-lookup returns a nil response. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
@@ -6,6 +6,7 @@ package dns64
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"time"
|
||||
|
||||
@@ -122,6 +123,9 @@ func (d *DNS64) DoDNS64(ctx context.Context, w dns.ResponseWriter, r *dns.Msg, o
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if resp == nil {
|
||||
return nil, fmt.Errorf("dns64: upstream returned no response")
|
||||
}
|
||||
out := d.Synthesize(r, origResponse, resp)
|
||||
return out, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user