commit | 078779b8f2d83d3faf06633707560018f91a9e82 | [log] [tgz] |
---|---|---|
author | Dreamacro <chuainian@gmail.com> | Thu Jan 02 13:28:56 2020 +0000 |
committer | Ian Lance Taylor <iant@golang.org> | Sat Feb 22 03:33:25 2020 +0000 |
tree | de95d4d91f704e8df4c8ce10d931f8cc65c5fb31 | |
parent | 46282727080fcf56da5781d0a9ef2fda184be5e6 [diff] |
route: fill correctly field https://github.com/golang/net/blob/master/route/address.go#L37-L56 Wrong order of filling the buffer Change-Id: Ia598a1f9aaba03f1c0e9890bcf48ed097eb0a1e6 GitHub-Last-Rev: 1ed3d11bbd87fa4f0aeed840ba3be29e504354fd GitHub-Pull-Request: golang/net#60 Reviewed-on: https://go-review.googlesource.com/c/net/+/213117 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
diff --git a/route/address.go b/route/address.go index b715281..e3125a4 100644 --- a/route/address.go +++ b/route/address.go
@@ -46,12 +46,12 @@ data := b[8:] if nlen > 0 { b[5] = byte(nlen) - copy(data[:nlen], a.Addr) + copy(data[:nlen], a.Name) data = data[nlen:] } if alen > 0 { b[6] = byte(alen) - copy(data[:alen], a.Name) + copy(data[:alen], a.Addr) data = data[alen:] } return ll, nil