diff mbox series

ARM: s3c: Use strscpy to replace strlcpy

Message ID 1f4faebf.9e6.180ec52dc40.Coremail.chenxuebing@jari.cn (mailing list archive)
State Accepted
Commit c241d049122b49698d9094c7ee7a0215fbc04cfe
Headers show
Series ARM: s3c: Use strscpy to replace strlcpy | expand

Commit Message

XueBing Chen May 22, 2022, 3:11 p.m. UTC
The strlcpy should not be used because it doesn't limit the source
length.  Preferred is strscpy.

Signed-off-by: XueBing Chen <chenxuebing@jari.cn>
---
 arch/arm/mach-s3c/mach-mini2440.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Krzysztof Kozlowski May 23, 2022, 7:10 a.m. UTC | #1
On 22/05/2022 17:11, 陈学兵 wrote:
> 
> The strlcpy should not be used because it doesn't limit the source
> length.  Preferred is strscpy.
> 
> Signed-off-by: XueBing Chen <chenxuebing@jari.cn>

Your name in From field does not match exactly one used in
Signed-off-by. Name might be actually the same, but different alphabet
is used. Please use the same one - latin transliteration - in both cases.

> ---
>  arch/arm/mach-s3c/mach-mini2440.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-s3c/mach-mini2440.c b/arch/arm/mach-s3c/mach-mini2440.c
> index 551ec660ab59..98cebc06521c 100644
> --- a/arch/arm/mach-s3c/mach-mini2440.c
> +++ b/arch/arm/mach-s3c/mach-mini2440.c
> @@ -624,7 +624,7 @@ static char mini2440_features_str[12] __initdata = "0tb";
>  static int __init mini2440_features_setup(char *str)
>  {
>  	if (str)
> -		strlcpy(mini2440_features_str, str,
> +		strscpy(mini2440_features_str, str,
>  			sizeof(mini2440_features_str));
>  	return 1;
>  }


Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/arch/arm/mach-s3c/mach-mini2440.c b/arch/arm/mach-s3c/mach-mini2440.c
index 551ec660ab59..98cebc06521c 100644
--- a/arch/arm/mach-s3c/mach-mini2440.c
+++ b/arch/arm/mach-s3c/mach-mini2440.c
@@ -624,7 +624,7 @@  static char mini2440_features_str[12] __initdata = "0tb";
 static int __init mini2440_features_setup(char *str)
 {
 	if (str)
-		strlcpy(mini2440_features_str, str,
+		strscpy(mini2440_features_str, str,
 			sizeof(mini2440_features_str));
 	return 1;
 }