From 70f6c42556afad75fa5c9734fe02cd8d2679ed0b Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Mon, 16 Sep 2019 19:38:33 -0600 Subject: wintun: use correct length for security attributes --- tun/wintun/namespace_windows.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tun') 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) -- cgit v1.2.3