Avoid returning slice into buffer from Readfile

Signed-off-by: eriknordmark <erik@zededa.com>
pull/1033/head
eriknordmark 4 years ago
parent 3585d276bc
commit 0e13743b77

@ -821,8 +821,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 = 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 {

Loading…
Cancel
Save