Commit 8619e94d authored by ye xingchen's avatar ye xingchen Committed by Tejun Heo

cgroup: use strscpy() is more robust and safer

The implementation of strscpy() is more robust and safer.

That's now the recommended way to copy NUL terminated strings.
Signed-off-by: default avatarye xingchen <ye.xingchen@zte.com.cn>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent b74440d8
......@@ -2374,7 +2374,7 @@ int task_cgroup_path(struct task_struct *task, char *buf, size_t buflen)
ret = cgroup_path_ns_locked(cgrp, buf, buflen, &init_cgroup_ns);
} else {
/* if no hierarchy exists, everyone is in "/" */
ret = strlcpy(buf, "/", buflen);
ret = strscpy(buf, "/", buflen);
}
spin_unlock_irq(&css_set_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment