Skip to content

Commit 6bc3396

Browse files
fix(process,windows): compare len(cwd) to an incorrect value
process/process_windows.go#L411 len(cwd) need compare to userProcParams.CurrentDirectoryPathNameLength instead of userProcParams.CurrentDirectoryPathAddress
1 parent ed37dc2 commit 6bc3396

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)