1
0
mirror of https://git.zx2c4.com/wireguard-go synced 2024-11-15 01:05:15 +01:00

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)
}
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)