diff --git a/v3/process/process_linux.go b/v3/process/process_linux.go index fb0421fb4..f9be594dc 100644 --- a/v3/process/process_linux.go +++ b/v3/process/process_linux.go @@ -816,8 +816,12 @@ func (p *Process) fillFromStatusWithContext(ctx context.Context) error { } } } + // Ensure we have a copy and not reference into slice + p.name = string([]byte(p.name)) case "State": p.status = convertStatusChar(value[0:1]) + // Ensure we have a copy and not reference into slice + p.status = string([]byte(p.status)) case "PPid", "Ppid": pval, err := strconv.ParseInt(value, 10, 32) if err != nil {