summaryrefslogtreecommitdiffstats
path: root/llgo/third_party/gofrontend/libgo/go/net/dnsmsg.go
diff options
context:
space:
mode:
Diffstat (limited to 'llgo/third_party/gofrontend/libgo/go/net/dnsmsg.go')
-rw-r--r--llgo/third_party/gofrontend/libgo/go/net/dnsmsg.go18
1 files changed, 17 insertions, 1 deletions
diff --git a/llgo/third_party/gofrontend/libgo/go/net/dnsmsg.go b/llgo/third_party/gofrontend/libgo/go/net/dnsmsg.go
index 161afb2a556..6ecaa948230 100644
--- a/llgo/third_party/gofrontend/libgo/go/net/dnsmsg.go
+++ b/llgo/third_party/gofrontend/libgo/go/net/dnsmsg.go
@@ -306,7 +306,23 @@ func (rr *dnsRR_TXT) Header() *dnsRR_Header {
}
func (rr *dnsRR_TXT) Walk(f func(v interface{}, name, tag string) bool) bool {
- return rr.Hdr.Walk(f) && f(&rr.Txt, "Txt", "")
+ if !rr.Hdr.Walk(f) {
+ return false
+ }
+ var n uint16 = 0
+ for n < rr.Hdr.Rdlength {
+ var txt string
+ if !f(&txt, "Txt", "") {
+ return false
+ }
+ // more bytes than rr.Hdr.Rdlength said there woudld be
+ if rr.Hdr.Rdlength-n < uint16(len(txt))+1 {
+ return false
+ }
+ n += uint16(len(txt)) + 1
+ rr.Txt += txt
+ }
+ return true
}
type dnsRR_SRV struct {
OpenPOWER on IntegriCloud