aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordatabase64128 <free122448@hotmail.com>2025-08-18 16:55:40 +0800
committerGopher Robot <gobot@golang.org>2025-08-25 10:50:07 -0700
commitbbd5342a62baa2fa6b42d444b05717c2563d0764 (patch)
treed294000c4b78c6eea1e59bc84ea256d92c6ebf1e /src
parented7f804775725149088a71108efd0b20ef9f206f (diff)
downloadgo-bbd5342a62baa2fa6b42d444b05717c2563d0764.tar.xz
net: fix cgoResSearch
CL 457439 mistakenly redeclared size inside the for loop, causing cgoResSearch to always fail and fall back to goLookupCNAME. Change-Id: I3e142d34287388284a8998ac13761b1e0c2911a5 Reviewed-on: https://go-review.googlesource.com/c/go/+/696895 Reviewed-by: Damien Neil <dneil@google.com> Auto-Submit: Damien Neil <dneil@google.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Mateusz Poliwczak <mpoliwczak34@gmail.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src')
-rw-r--r--src/net/cgo_unix.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/net/cgo_unix.go b/src/net/cgo_unix.go
index 3afa014b6f..1e170dbc0a 100644
--- a/src/net/cgo_unix.go
+++ b/src/net/cgo_unix.go
@@ -351,7 +351,7 @@ func cgoResSearch(hostname string, rtype, class int) ([]dnsmessage.Resource, err
var size int
for {
- size := _C_res_nsearch(state, (*_C_char)(unsafe.Pointer(s)), class, rtype, buf, bufSize)
+ size = _C_res_nsearch(state, (*_C_char)(unsafe.Pointer(s)), class, rtype, buf, bufSize)
if size <= 0 || size > 0xffff {
return nil, errors.New("res_nsearch failure")
}