The strlcpy should not be used because it doesn't limit the source length. Preferred is strscpy. Signed-off-by: XueBing Chen <chenxuebing@xxxxxxx> --- arch/m68k/emu/natfeat.c | 2 +- arch/m68k/kernel/setup_mm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/m68k/emu/natfeat.c b/arch/m68k/emu/natfeat.c index 71b78ecee75c..a17637b2b237 100644 --- a/arch/m68k/emu/natfeat.c +++ b/arch/m68k/emu/natfeat.c @@ -43,7 +43,7 @@ long nf_get_id(const char *feature_name) char name_copy[32]; size_t n; - n = strlcpy(name_copy, feature_name, sizeof(name_copy)); + n = strscpy(name_copy, feature_name, sizeof(name_copy)); if (n >= sizeof(name_copy)) return 0; diff --git a/arch/m68k/kernel/setup_mm.c b/arch/m68k/kernel/setup_mm.c index 8f94feed969c..526bd1781d73 100644 --- a/arch/m68k/kernel/setup_mm.c +++ b/arch/m68k/kernel/setup_mm.c @@ -158,7 +158,7 @@ static void __init m68k_parse_bootinfo(const struct bi_record *record) break; case BI_COMMAND_LINE: - strlcpy(m68k_command_line, data, + strscpy(m68k_command_line, data, sizeof(m68k_command_line)); break; -- 2.36.1