summaryrefslogtreecommitdiffhomepage
path: root/tun
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@tailscale.com>2020-10-20 21:13:15 -0700
committerJason A. Donenfeld <Jason@zx2c4.com>2020-10-21 18:26:10 +0200
commit58a8f05f50b633bb45c7cc299c405618489c18ad (patch)
tree65dea9558c57378026da316bfd6de4bf1b95e24a /tun
parent0b54907a73ce0810c3a148007c45e66eae7109d6 (diff)
tun/wintun/registry: fix Go 1.15 race/checkptr failure
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com> [Jason: ran go mod tidy.] Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'tun')
-rw-r--r--tun/wintun/registry/registry_windows.go2
1 files changed, 1 insertions, 1 deletions
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