Merge pull request #1346 from tienthanh1993/master

fix(process,windows): compare len(cwd) to an incorrect value
pull/1348/head
shirou 3 years ago committed by GitHub
commit a63ec01c75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -408,7 +408,7 @@ func (p *Process) CwdWithContext(_ context.Context) (string, error) {
}
if userProcParams.CurrentDirectoryPathNameLength > 0 {
cwd := readProcessMemory(syscall.Handle(h), procIs32Bits, uint64(userProcParams.CurrentDirectoryPathAddress), uint(userProcParams.CurrentDirectoryPathNameLength))
if len(cwd) != int(userProcParams.CurrentDirectoryPathAddress) {
if len(cwd) != int(userProcParams.CurrentDirectoryPathNameLength) {
return "", errors.New("cannot read current working directory")
}

Loading…
Cancel
Save