diff options
Diffstat (limited to 'conf/dpapi/dpapi_windows_test.go')
-rw-r--r-- | conf/dpapi/dpapi_windows_test.go | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/conf/dpapi/dpapi_windows_test.go b/conf/dpapi/dpapi_windows_test.go index 8356f2d4..fd7307e6 100644 --- a/conf/dpapi/dpapi_windows_test.go +++ b/conf/dpapi/dpapi_windows_test.go @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: MIT * - * Copyright (C) 2019 WireGuard LLC. All Rights Reserved. + * Copyright (C) 2019-2022 WireGuard LLC. All Rights Reserved. */ package dpapi @@ -53,11 +53,7 @@ func TestRoundTrip(t *testing.T) { if err != nil { t.Errorf("Unable to get utf16 chars for name: %s", err) } - nameUtf16Bytes := *(*[]byte)(unsafe.Pointer(&struct { - addr *byte - len int - cap int - }{(*byte)(unsafe.Pointer(&nameUtf16[0])), len(nameUtf16) * 2, cap(nameUtf16) * 2})) + nameUtf16Bytes := unsafe.Slice((*byte)(unsafe.Pointer(&nameUtf16[0])), len(nameUtf16)*2) i := bytes.Index(eCorrupt, nameUtf16Bytes) if i == -1 { t.Error("Unable to find ad in blob") |