summaryrefslogtreecommitdiffstats
path: root/arch/ia64/kernel
diff options
context:
space:
mode:
authorxu xin <xu.xin16@zte.com.cn>2022-09-30 06:19:50 +0000
committerAndrew Morton <akpm@linux-foundation.org>2022-10-11 18:51:10 -0700
commit95e9a8552e85a7b7c885d3458c7c74c28dfe359b (patch)
tree51a10e4884d3cd192f968c2e4d3ff1d6f431bfa2 /arch/ia64/kernel
parent30341ec95af4f6e85b981c975c23929bbea8b58a (diff)
downloadlinux-stable-95e9a8552e85a7b7c885d3458c7c74c28dfe359b.tar.gz
linux-stable-95e9a8552e85a7b7c885d3458c7c74c28dfe359b.tar.bz2
linux-stable-95e9a8552e85a7b7c885d3458c7c74c28dfe359b.zip
ia64: mca: 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. Link: https://lkml.kernel.org/r/20220930061950.288290-1-xu.xin16@zte.com.cn Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Xu Panda <xu.panda@zte.com.cn> Signed-off-by: xu xin <xu.xin16@zte.com.cn> Cc: Haowen Bai <baihaowen@meizu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'arch/ia64/kernel')
-rw-r--r--arch/ia64/kernel/mca.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c
index c62a66710ad6..92ede80d17fe 100644
--- a/arch/ia64/kernel/mca.c
+++ b/arch/ia64/kernel/mca.c
@@ -1793,7 +1793,7 @@ format_mca_init_stack(void *mca_data, unsigned long offset,
p->parent = p->real_parent = p->group_leader = p;
INIT_LIST_HEAD(&p->children);
INIT_LIST_HEAD(&p->sibling);
- strncpy(p->comm, type, sizeof(p->comm)-1);
+ strscpy(p->comm, type, sizeof(p->comm)-1);
}
/* Caller prevents this from being called after init */