mirror of
https://github.com/docker/docker-credential-helpers.git
synced 2026-06-13 16:01:28 +05:30
vendor: github.com/danieljoos/wincred v1.2.3
fix unsafe uintptr usage to be GC-safe on go1.25 full diff: https://github.com/danieljoos/wincred/compare/v1.2.2...v1.2.3 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
+6
-3
@@ -5,6 +5,7 @@ package wincred
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"runtime"
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
@@ -33,10 +34,10 @@ type sysCREDENTIAL struct {
|
||||
Comment *uint16
|
||||
LastWritten windows.Filetime
|
||||
CredentialBlobSize uint32
|
||||
CredentialBlob uintptr
|
||||
CredentialBlob *byte
|
||||
Persist uint32
|
||||
AttributeCount uint32
|
||||
Attributes uintptr
|
||||
Attributes *sysCREDENTIAL_ATTRIBUTE
|
||||
TargetAlias *uint16
|
||||
UserName *uint16
|
||||
}
|
||||
@@ -46,7 +47,7 @@ type sysCREDENTIAL_ATTRIBUTE struct {
|
||||
Keyword *uint16
|
||||
Flags uint32
|
||||
ValueSize uint32
|
||||
Value uintptr
|
||||
Value *byte
|
||||
}
|
||||
|
||||
// https://docs.microsoft.com/en-us/windows/desktop/api/wincred/ns-wincred-_credentialw
|
||||
@@ -93,6 +94,8 @@ func sysCredWrite(cred *Credential, typ sysCRED_TYPE) error {
|
||||
uintptr(unsafe.Pointer(ncred)),
|
||||
0,
|
||||
)
|
||||
// Make sure everything reachable from ncred stays alive through the call.
|
||||
runtime.KeepAlive(ncred)
|
||||
if ret == 0 {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user