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>
This commit is contained in:
committed by
Jason A. Donenfeld
parent
0b54907a73
commit
58a8f05f50
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user