From: Greg Ungerer <gerg@linux-m68k.org>
To: Mohammad Mahdi Anbaraki <m.mahdianbaraki@gmail.com>,
geert@linux-m68k.org
Cc: linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] m68k/kernel: replace strncpy() with strscpy()
Date: Mon, 28 Apr 2025 09:42:36 +1000 [thread overview]
Message-ID: <8c474cf7-87ba-424b-a7da-dab917d0a305@linux-m68k.org> (raw)
In-Reply-To: <20250403181200.34418-1-m.mahdianbaraki@gmail.com>
Hi Homammad,
On 4/4/25 04:11, Mohammad Mahdi Anbaraki wrote:
> Swapped out strncpy() for strscpy() in parse_uboot_commandline() while
> copying to commandp. strscpy() makes sure the string is properly null-
> terminated and gives a more useful return value so it's just a safer
> choice overall.
>
> Link: https://github.com/KSPP/linux/issues/90
> Signed-off-by: Mohammad Mahdi Anbaraki <m.mahdianbaraki@gmail.com>
Thanks. Seeing as this only affects nommu/coldfire I will apply this
to the m68knommu git tree, for-next branch.
Regards
Greg
> ---
> Changes in v2:
> - s/m64/m68
>
> arch/m68k/kernel/uboot.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/m68k/kernel/uboot.c b/arch/m68k/kernel/uboot.c
> index 5e52ea150..fa7c279ea 100644
> --- a/arch/m68k/kernel/uboot.c
> +++ b/arch/m68k/kernel/uboot.c
> @@ -73,7 +73,7 @@ static void __init parse_uboot_commandline(char *commandp, int size)
> uboot_cmd_end = sp[5];
>
> if (uboot_cmd_start && uboot_cmd_end)
> - strncpy(commandp, (const char *)uboot_cmd_start, size);
> + strscpy(commandp, (const char *)uboot_cmd_start, size);
>
> #if defined(CONFIG_BLK_DEV_INITRD)
> uboot_initrd_start = sp[2];
prev parent reply other threads:[~2025-04-27 23:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-03 18:11 Mohammad Mahdi Anbaraki
2025-04-22 18:00 ` mohammad mahdi anbaraki
2025-04-27 23:42 ` Greg Ungerer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8c474cf7-87ba-424b-a7da-dab917d0a305@linux-m68k.org \
--to=gerg@linux-m68k.org \
--cc=geert@linux-m68k.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-m68k@lists.linux-m68k.org \
--cc=m.mahdianbaraki@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®