]> Cypherpunks repositories - gostls13.git/commit
syscall: fix windows WSASendto -d=checkptr violation
authorAlex Brainman <alex.brainman@gmail.com>
Tue, 25 Feb 2020 07:44:55 +0000 (18:44 +1100)
committerAlex Brainman <alex.brainman@gmail.com>
Thu, 2 Apr 2020 09:00:34 +0000 (09:00 +0000)
commit9667294d8f5c8c6e2c48efa1ced98cb7e9cfaf51
treefdf4049b354a9b068159fe1006a9bbb610bf7e61
parent95773ab9b053edc43ba07a182f3d5e0e29775a45
syscall: fix windows WSASendto -d=checkptr violation

WSASendto converts unsafe.Pointer to *syscall.RawSockaddrAny. But that
violates every rule of

https://golang.org/pkg/unsafe/#Pointer

Implement WSASendto by calling Windows WSASendTo API by calling
syscall.Syscall9 directly. This allows us to comply with

(4) Conversion of a Pointer to a uintptr when calling syscall.Syscall

rule.

After this change, this commands succeeds:

go test -a -short -gcflags=all=-d=checkptr -run=TestPacketConn net

Updates #34972

Change-Id: Ib9a810bedf9e05251b7d3c7f69e15bfbd177ac62
Reviewed-on: https://go-review.googlesource.com/c/go/+/220544
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/syscall/syscall_windows.go