mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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>
This commit is contained in:
parent
ed7f804775
commit
bbd5342a62
1 changed files with 1 additions and 1 deletions
|
|
@ -351,7 +351,7 @@ func cgoResSearch(hostname string, rtype, class int) ([]dnsmessage.Resource, err
|
||||||
|
|
||||||
var size int
|
var size int
|
||||||
for {
|
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 {
|
if size <= 0 || size > 0xffff {
|
||||||
return nil, errors.New("res_nsearch failure")
|
return nil, errors.New("res_nsearch failure")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue