mirror of
https://github.com/github/codeql.git
synced 2026-07-08 13:05:36 +02:00
Use windows.ByteSliceFromString for null-terminated drive path
This commit is contained in:
committed by
GitHub
parent
e27ed44f76
commit
1870a01df5
@@ -45,7 +45,10 @@ func ResolveDrive(driveRoot string) string {
|
||||
if !available {
|
||||
return ""
|
||||
}
|
||||
driveBytes := append([]byte(driveRoot), 0)
|
||||
driveBytes, err := windows.ByteSliceFromString(driveRoot)
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
ret, _, _ := procResolve.Call(uintptr(unsafe.Pointer(&driveBytes[0])))
|
||||
if ret == 0 {
|
||||
return ""
|
||||
|
||||
Reference in New Issue
Block a user