From: Heiko Carstens <hca@linux.ibm.com>
To: Amir Mohammad Jahangirzad <a.jahangirzad@gmail.com>
Cc: gor@linux.ibm.com, agordeev@linux.ibm.com,
borntraeger@linux.ibm.com, svens@linux.ibm.com,
linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] s390/boot: replace strncpy() with strscpy()
Date: Wed, 9 Apr 2025 15:31:39 +0200 [thread overview]
Message-ID: <20250409133139.7333Ccd-hca@linux.ibm.com> (raw)
In-Reply-To: <20250402231433.117505-1-a.jahangirzad@gmail.com>
On Thu, Apr 03, 2025 at 02:44:34AM +0330, Amir Mohammad Jahangirzad wrote:
> From: "Amir Mohammad Jahangirzad" <a.jahangirzad@gmail.com>
>
> strncpy() is deprecated for use on NUL-terminated destination strings
> as it doesn't guarantee NUL-termination when the source string length
> exceeds the destination buffer size. strscpy() is a safer alternative
> as it always NUL-terminates the destination and returns the number of
> characters copied (excluding the NUL).
>
> Replace strncpy() with strscpy() for copying the bootdebug_filter value,
> using sizeof(bootdebug_filter) rather than sizeof()-1 since strscpy()
> takes the full buffer size as parameter.
>
>
> Link: https://github.com/KSPP/linux/issues/90
> Signed-off-by: Amir Mohammad Jahangirzad <a.jahangirzad@gmail.com>
> ---
> arch/s390/boot/ipl_parm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
You could have at least compile tested this before sending.
prev parent reply other threads:[~2025-04-09 13:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-02 23:14 [PATCH] s390/boot: replace strncpy() with strscpy() Amir Mohammad Jahangirzad
2025-04-09 13:31 ` Heiko Carstens [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=20250409133139.7333Ccd-hca@linux.ibm.com \
--to=hca@linux.ibm.com \
--cc=a.jahangirzad@gmail.com \
--cc=agordeev@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=svens@linux.ibm.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