mirror of
https://github.com/torvalds/linux.git
synced 2024-11-25 21:51:40 +00:00
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>
This commit is contained in:
parent
30341ec95a
commit
95e9a8552e
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user