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:
Yong Tang
2026-09-02 21:07:28 -07:00
committed by GitHub
parent 88ab058ba2
commit f1d835aa51
2 changed files with 31 additions and 0 deletions

View File

@@ -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
}