[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250409133139.7333Ccd-hca@linux.ibm.com>
Date: Wed, 9 Apr 2025 15:31:39 +0200
From: Heiko Carstens <hca@...ux.ibm.com>
To: Amir Mohammad Jahangirzad <a.jahangirzad@...il.com>
Cc: gor@...ux.ibm.com, agordeev@...ux.ibm.com, borntraeger@...ux.ibm.com,
svens@...ux.ibm.com, linux-s390@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] s390/boot: replace strncpy() with strscpy()
On Thu, Apr 03, 2025 at 02:44:34AM +0330, Amir Mohammad Jahangirzad wrote:
> From: "Amir Mohammad Jahangirzad" <a.jahangirzad@...il.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@...il.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.
Powered by blists - more mailing lists