linux-m68k.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH linux-next] m68k: Move from strlcpy with unused retval to strscpy
       [not found] <20220930080717.290016-1-xu.panda@zte.com.cn>
@ 2022-09-30  9:36 ` Geert Uytterhoeven
  0 siblings, 0 replies; only message in thread
From: Geert Uytterhoeven @ 2022-09-30  9:36 UTC (permalink / raw)
  To: cgel.zte
  Cc: laurent, arnd, rppt, dmitry.osipenko, fthain, linux-kernel,
	Xu Panda, Zeal Robot, linux-m68k

CC linux-m68k

On Fri, Sep 30, 2022 at 10:07 AM <cgel.zte@gmail.com> wrote:
> From: Xu Panda <xu.panda@zte.com.cn>
>
> The implementation of strscpy() is more robust and safer.
> That's now the recommended way to copy NUL terminated strings.
>
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Xu Panda <xu.panda@zte.com.cn>
> ---
>  arch/m68k/kernel/setup_mm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/m68k/kernel/setup_mm.c b/arch/m68k/kernel/setup_mm.c
> index 06ee394db610..401a8deb6ffc 100644
> --- a/arch/m68k/kernel/setup_mm.c
> +++ b/arch/m68k/kernel/setup_mm.c
> @@ -231,7 +231,7 @@ void __init setup_arch(char **cmdline_p)
>         setup_initial_init_mm((void *)PAGE_OFFSET, _etext, _edata, _end);
>
>  #if defined(CONFIG_BOOTPARAM)
> -       strncpy(m68k_command_line, CONFIG_BOOTPARAM_STRING, CL_SIZE);
> +       strscpy(m68k_command_line, CONFIG_BOOTPARAM_STRING, CL_SIZE);
>         m68k_command_line[CL_SIZE - 1] = 0;
>  #endif /* CONFIG_BOOTPARAM */
>         process_uboot_commandline(&m68k_command_line[0], CL_SIZE);
> --
> 2.15.2

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-09-30  9:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20220930080717.290016-1-xu.panda@zte.com.cn>
2022-09-30  9:36 ` [PATCH linux-next] m68k: Move from strlcpy with unused retval to strscpy Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).