aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxu xin <[email protected]>2022-09-30 06:19:50 +0000
committerAndrew Morton <[email protected]>2022-10-11 18:51:10 -0700
commit95e9a8552e85a7b7c885d3458c7c74c28dfe359b (patch)
tree51a10e4884d3cd192f968c2e4d3ff1d6f431bfa2
parent30341ec95af4f6e85b981c975c23929bbea8b58a (diff)
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/[email protected] Reported-by: Zeal Robot <[email protected]> Signed-off-by: Xu Panda <[email protected]> Signed-off-by: xu xin <[email protected]> Cc: Haowen Bai <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
-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 */