wintun: use correct length for security attributes

This commit is contained in:
Jason A. Donenfeld 2019-09-16 19:38:33 -06:00
parent bb0b2514c0
commit 70f6c42556

View file

@ -37,7 +37,7 @@ func initializeNamespace() error {
return fmt.Errorf("SddlToSecurityDescriptor failed: %v", err) return fmt.Errorf("SddlToSecurityDescriptor failed: %v", err)
} }
wintunObjectSecurityAttributes = &windows.SecurityAttributes{ wintunObjectSecurityAttributes = &windows.SecurityAttributes{
Length: uint32(len(sd)), Length: uint32(unsafe.Sizeof(windows.SecurityAttributes{})),
SecurityDescriptor: uintptr(unsafe.Pointer(&sd[0])), SecurityDescriptor: uintptr(unsafe.Pointer(&sd[0])),
} }
sid, err := windows.CreateWellKnownSid(windows.WinLocalSystemSid) sid, err := windows.CreateWellKnownSid(windows.WinLocalSystemSid)