microsoft / go-winio

Win32 IO-related utilities for Go
MIT License
953 stars 181 forks source link

sd.go: fix calculation of security descriptor length in SddlToSecurit… #299

Closed dblohm7 closed 1 year ago

dblohm7 commented 1 year ago

…yDescriptor

unsafe.Sizeof(windows.SECURITY_DESCRIPTOR{}) is the minimum length of the SD, not the actual length. Use the actual length for computing the length of the slice.

This path also removes getSecurityDescriptorLength, which is no longer used.

dblohm7 commented 1 year ago

@microsoft-github-policy-service agree company="Tailscale Inc."