diff --git a/go.mod b/go.mod index 0bf4685f39e472d043d5be4b28f056d6bea1b2f4..7670717b3ef011166003fce48cb2ee89c305ef02 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/google/subcommands v1.2.0 github.com/jmcvetta/randutil v0.0.0-20150817122601-2bb1b664bcff github.com/lpar/gzipped v1.1.1-0.20190413023519-5d9a18ea7f47 - github.com/miekg/dns v1.1.37 + github.com/miekg/dns v1.1.38 github.com/prometheus/client_golang v1.9.0 go.etcd.io/etcd v0.5.0-alpha.5.0.20190401205724-a621d807f061 golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad diff --git a/go.sum b/go.sum index 8f6b6e99b905f92642c6c6041d477a8fb13dbd92..aaf0c4589adfe5b6a8aa47acf41392fd0f3dded2 100644 --- a/go.sum +++ b/go.sum @@ -200,6 +200,8 @@ github.com/miekg/dns v1.1.35 h1:oTfOaDH+mZkdcgdIjH6yBajRGtIwcwcaR+rt23ZSrJs= github.com/miekg/dns v1.1.35/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= github.com/miekg/dns v1.1.37 h1:+kky2ArpBqk0S/74RkwFjmKM9jja7AB1RN7VUuVq0iM= github.com/miekg/dns v1.1.37/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= +github.com/miekg/dns v1.1.38 h1:MtIY+fmHUVVgv1AXzmKMWcwdCYxTRPG1EDjpqF4RCEw= +github.com/miekg/dns v1.1.38/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= diff --git a/vendor/github.com/miekg/dns/dns.go b/vendor/github.com/miekg/dns/dns.go index 33c93b2bfd2b89684e72c6ce22d85ab80c85056d..a88484b06234d28bed0d7c0fb2fc10157b3d6948 100644 --- a/vendor/github.com/miekg/dns/dns.go +++ b/vendor/github.com/miekg/dns/dns.go @@ -134,9 +134,14 @@ func (rr *RFC3597) ToRFC3597(r RR) error { // fromRFC3597 converts an unknown RR representation from RFC 3597 to the known RR type. func (rr *RFC3597) fromRFC3597(r RR) error { - *r.Header() = rr.Hdr + hdr := r.Header() + *hdr = rr.Hdr - if len(rr.Rdata) == 0 { + // Can't overflow uint16 as the length of Rdata is validated in (*RFC3597).parse. + // We can only get here when rr was constructed with that method. + hdr.Rdlength = uint16(hex.DecodedLen(len(rr.Rdata))) + + if noRdata(*hdr) { // Dynamic update. return nil } diff --git a/vendor/github.com/miekg/dns/msg.go b/vendor/github.com/miekg/dns/msg.go index 7001f6da79c88ee68f90c6438814f5b39b6e579d..1728a98b7dc2ece72793785c526afc065c41b04d 100644 --- a/vendor/github.com/miekg/dns/msg.go +++ b/vendor/github.com/miekg/dns/msg.go @@ -624,11 +624,18 @@ func UnpackRRWithHeader(h RR_Header, msg []byte, off int) (rr RR, off1 int, err rr = &RFC3597{Hdr: h} } - if noRdata(h) { - return rr, off, nil + if off < 0 || off > len(msg) { + return &h, off, &Error{err: "bad off"} } end := off + int(h.Rdlength) + if end < off || end > len(msg) { + return &h, end, &Error{err: "bad rdlength"} + } + + if noRdata(h) { + return rr, off, nil + } off, err = rr.unpack(msg, off) if err != nil { diff --git a/vendor/github.com/miekg/dns/scan_rr.go b/vendor/github.com/miekg/dns/scan_rr.go index 69f10052f4ebe57bc94470ca560cb208628de9ff..23b4043bcd5f4843a158b89ad33cd67112255fcc 100644 --- a/vendor/github.com/miekg/dns/scan_rr.go +++ b/vendor/github.com/miekg/dns/scan_rr.go @@ -1387,7 +1387,7 @@ func (rr *RFC3597) parse(c *zlexer, o string) *ParseError { c.Next() // zBlank l, _ = c.Next() - rdlength, e := strconv.Atoi(l.token) + rdlength, e := strconv.ParseUint(l.token, 10, 16) if e != nil || l.err { return &ParseError{"", "bad RFC3597 Rdata ", l} } @@ -1396,7 +1396,7 @@ func (rr *RFC3597) parse(c *zlexer, o string) *ParseError { if e1 != nil { return e1 } - if rdlength*2 != len(s) { + if int(rdlength)*2 != len(s) { return &ParseError{"", "bad RFC3597 Rdata", l} } rr.Rdata = s diff --git a/vendor/github.com/miekg/dns/version.go b/vendor/github.com/miekg/dns/version.go index ea3401fac8d062ad6b765cfe0e04dd7a40d4bd7b..dc80a8264f4e70985063dd18b0784344c4cbc457 100644 --- a/vendor/github.com/miekg/dns/version.go +++ b/vendor/github.com/miekg/dns/version.go @@ -3,7 +3,7 @@ package dns import "fmt" // Version is current version of this library. -var Version = v{1, 1, 37} +var Version = v{1, 1, 38} // v holds the version of this library. type v struct { diff --git a/vendor/modules.txt b/vendor/modules.txt index 5fe38e7ea7fe5bffbc069a2eea65fb3f5ed396ae..8f988a31932b9c8dbe77f613ab6ccbba02537e19 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -70,7 +70,7 @@ github.com/konsorten/go-windows-terminal-sequences github.com/lpar/gzipped # github.com/matttproud/golang_protobuf_extensions v1.0.1 github.com/matttproud/golang_protobuf_extensions/pbutil -# github.com/miekg/dns v1.1.37 +# github.com/miekg/dns v1.1.38 ## explicit github.com/miekg/dns # github.com/prometheus/client_golang v1.9.0