Skip to content

Commit

Permalink
Merge pull request #1346 from tienthanh1993/master
Browse files Browse the repository at this point in the history
fix(process,windows): compare len(cwd) to an incorrect value
  • Loading branch information
shirou committed Sep 4, 2022
2 parents ed37dc2 + 6bc3396 commit a63ec01
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion process/process_windows.go
Expand Up @@ -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")
}

Expand Down

0 comments on commit a63ec01

Please sign in to comment.