From: Jason A. Donenfeld Date: Tue, 17 Sep 2019 01:38:33 +0000 (-0600) Subject: wintun: use correct length for security attributes X-Git-Tag: 0.0.20191012~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=70f6c42556afad75fa5c9734fe02cd8d2679ed0b;p=thirdparty%2Fwireguard-go.git wintun: use correct length for security attributes --- diff --git a/tun/wintun/namespace_windows.go b/tun/wintun/namespace_windows.go index 01fff91..de781a5 100644 --- a/tun/wintun/namespace_windows.go +++ b/tun/wintun/namespace_windows.go @@ -37,7 +37,7 @@ func initializeNamespace() error { return fmt.Errorf("SddlToSecurityDescriptor failed: %v", err) } wintunObjectSecurityAttributes = &windows.SecurityAttributes{ - Length: uint32(len(sd)), + Length: uint32(unsafe.Sizeof(windows.SecurityAttributes{})), SecurityDescriptor: uintptr(unsafe.Pointer(&sd[0])), } sid, err := windows.CreateWellKnownSid(windows.WinLocalSystemSid)