summaryrefslogtreecommitdiff
path: root/tools/lib
diff options
context:
space:
mode:
authorYuntao Wang <ytcoode@gmail.com>2022-03-04 10:04:08 +0300
committerAndrii Nakryiko <andrii@kernel.org>2022-03-08 09:04:33 +0300
commit03b9c7fa3f15f51bcd07f3828c2a01311e7746c4 (patch)
tree0c06340fc7c23e7edcaec27e902d871fd1183cc9 /tools/lib
parent9c6e6a80ee741adf6cb3cfd8eef7d1554f91fceb (diff)
downloadlinux-03b9c7fa3f15f51bcd07f3828c2a01311e7746c4.tar.xz
bpf: Replace strncpy() with strscpy()
Using strncpy() on NUL-terminated strings is considered deprecated[1]. Moreover, if the length of 'task->comm' is less than the destination buffer size, strncpy() will NUL-pad the destination buffer, which is a needless performance penalty. Replacing strncpy() with strscpy() fixes all these issues. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings Signed-off-by: Yuntao Wang <ytcoode@gmail.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Yonghong Song <yhs@fb.com> Link: https://lore.kernel.org/bpf/20220304070408.233658-1-ytcoode@gmail.com
Diffstat (limited to 'tools/lib')
0 files changed, 0 insertions, 0 deletions