From 58a8f05f50b633bb45c7cc299c405618489c18ad Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Tue, 20 Oct 2020 21:13:15 -0700 Subject: [PATCH] tun/wintun/registry: fix Go 1.15 race/checkptr failure Signed-off-by: Brad Fitzpatrick [Jason: ran go mod tidy.] Signed-off-by: Jason A. Donenfeld --- go.mod | 2 +- go.sum | 4 ++-- tun/wintun/registry/registry_windows.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index f264ea0..c8ae4c2 100644 --- a/go.mod +++ b/go.mod @@ -5,6 +5,6 @@ go 1.13 require ( golang.org/x/crypto v0.0.0-20200429183012-4b2356b1ed79 golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5 - golang.org/x/sys v0.0.0-20200501145240-bc7a7d42d5c3 + golang.org/x/sys v0.0.0-20201020230747-6e5568b54d1a golang.org/x/text v0.3.2 ) diff --git a/go.sum b/go.sum index e6b8991..c1a0370 100644 --- a/go.sum +++ b/go.sum @@ -7,8 +7,8 @@ golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501145240-bc7a7d42d5c3 h1:5B6i6EAiSYyejWfvc5Rc9BbI3rzIsrrXfAQBWnYfn+w= -golang.org/x/sys v0.0.0-20200501145240-bc7a7d42d5c3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201020230747-6e5568b54d1a h1:e3IU37lwO4aq3uoRKINC7JikojFmE5gO7xhfxs8VC34= +golang.org/x/sys v0.0.0-20201020230747-6e5568b54d1a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= diff --git a/tun/wintun/registry/registry_windows.go b/tun/wintun/registry/registry_windows.go index 6be88fd..70419a5 100644 --- a/tun/wintun/registry/registry_windows.go +++ b/tun/wintun/registry/registry_windows.go @@ -183,7 +183,7 @@ func toString(buf []byte, valueType uint32, err error) (string, error) { if len(buf) == 0 { return "", nil } - value = windows.UTF16ToString((*[(1 << 30) - 1]uint16)(unsafe.Pointer(&buf[0]))[:len(buf)/2]) + value = windows.UTF16PtrToString((*uint16)(unsafe.Pointer(&buf[0]))) default: return "", registry.ErrUnexpectedType