From a5a07ae83c4d4819b8ccd88f82401a44f8517e09 Mon Sep 17 00:00:00 2001 From: shirou Date: Mon, 1 Mar 2021 20:23:37 +0900 Subject: [PATCH] [process][linux] apply #1033 to v3. --- v3/process/process_linux.go | 4 ++++ 1 file changed, 4 insertions(+) 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 {