diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2016-07-22 18:15:38 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2016-07-22 18:15:38 +0000 |
commit | 22b955cca564a9a3a5b8c9d9dd1e295b7943c128 (patch) | |
tree | abdbd898676e1f853fca2d7e031d105d7ebcf676 /libgo/go/net/hosts.go | |
parent | 9d04a3af4c6491536badf6bde9707c907e4d196b (diff) | |
download | gcc-22b955cca564a9a3a5b8c9d9dd1e295b7943c128.zip gcc-22b955cca564a9a3a5b8c9d9dd1e295b7943c128.tar.gz gcc-22b955cca564a9a3a5b8c9d9dd1e295b7943c128.tar.bz2 |
libgo: update to go1.7rc3
Reviewed-on: https://go-review.googlesource.com/25150
From-SVN: r238662
Diffstat (limited to 'libgo/go/net/hosts.go')
-rw-r--r-- | libgo/go/net/hosts.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libgo/go/net/hosts.go b/libgo/go/net/hosts.go index c4de1b6..9c101c6 100644 --- a/libgo/go/net/hosts.go +++ b/libgo/go/net/hosts.go @@ -110,7 +110,9 @@ func lookupStaticHost(host string) []string { lowerHost := []byte(host) lowerASCIIBytes(lowerHost) if ips, ok := hosts.byName[absDomainName(lowerHost)]; ok { - return ips + ipsCp := make([]string, len(ips)) + copy(ipsCp, ips) + return ipsCp } } return nil @@ -127,7 +129,9 @@ func lookupStaticAddr(addr string) []string { } if len(hosts.byAddr) != 0 { if hosts, ok := hosts.byAddr[addr]; ok { - return hosts + hostsCp := make([]string, len(hosts)) + copy(hostsCp, hosts) + return hostsCp } } return nil |