Skip to content

Commit a63ec01

Browse files
authored
Merge pull request #1346 from tienthanh1993/master
fix(process,windows): compare len(cwd) to an incorrect value
2 parents ed37dc2 + 6bc3396 commit a63ec01

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

process/process_windows.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ func (p *Process) CwdWithContext(_ context.Context) (string, error) {
408408
}
409409
if userProcParams.CurrentDirectoryPathNameLength > 0 {
410410
cwd := readProcessMemory(syscall.Handle(h), procIs32Bits, uint64(userProcParams.CurrentDirectoryPathAddress), uint(userProcParams.CurrentDirectoryPathNameLength))
411-
if len(cwd) != int(userProcParams.CurrentDirectoryPathAddress) {
411+
if len(cwd) != int(userProcParams.CurrentDirectoryPathNameLength) {
412412
return "", errors.New("cannot read current working directory")
413413
}
414414

0 commit comments

Comments
 (0)