From b5d5184f72d2900cd61b7676edc45ad9300e26a9 Mon Sep 17 00:00:00 2001 From: Alex Brainman Date: Sun, 17 Nov 2019 11:10:08 +1100 Subject: [PATCH] windows: revert security_windows.go change of CL 202177 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change is golang.org/x/sys/windows copy of CL 204117. Updates golang/go#34972 Change-Id: I338c91bfe3971a80cbf44c2a0f1807adaa00918d Reviewed-on: https://go-review.googlesource.com/c/sys/+/207199 Run-TryBot: Alex Brainman TryBot-Result: Gobot Gobot Reviewed-by: Tobias Klauser --- windows/security_windows.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/windows/security_windows.go b/windows/security_windows.go index d88ed91a..4b6eff18 100644 --- a/windows/security_windows.go +++ b/windows/security_windows.go @@ -229,15 +229,13 @@ func LookupSID(system, account string) (sid *SID, domain string, accType uint32, // String converts SID to a string format suitable for display, storage, or transmission. func (sid *SID) String() string { - // From https://docs.microsoft.com/en-us/windows/win32/secbiomet/general-constants - const SecurityMaxSidSize = 68 var s *uint16 e := ConvertSidToStringSid(sid, &s) if e != nil { return "" } defer LocalFree((Handle)(unsafe.Pointer(s))) - return UTF16ToString((*[SecurityMaxSidSize]uint16)(unsafe.Pointer(s))[:]) + return UTF16ToString((*[256]uint16)(unsafe.Pointer(s))[:]) } // Len returns the length, in bytes, of a valid security identifier SID.