summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxu xin <xu.xin16@zte.com.cn>2022-09-30 09:19:50 +0300
committerAndrew Morton <akpm@linux-foundation.org>2022-10-12 04:51:10 +0300
commit95e9a8552e85a7b7c885d3458c7c74c28dfe359b (patch)
tree51a10e4884d3cd192f968c2e4d3ff1d6f431bfa2
parent30341ec95af4f6e85b981c975c23929bbea8b58a (diff)
downloadlinux-95e9a8552e85a7b7c885d3458c7c74c28dfe359b.tar.xz
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>
-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 */