diff mbox series

[v2] ARM: s3c: Use strscpy to replace strlcpy

Message ID 3e0217ca.a1d.180f90f39c7.Coremail.chenxuebing@jari.cn
State New
Headers show
Series [v2] ARM: s3c: Use strscpy to replace strlcpy | expand

Commit Message

XueBing Chen May 25, 2022, 2:32 a.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 June 7, 2022, 12:42 p.m. UTC | #1
On Wed, 25 May 2022 10:32:46 +0800 (GMT+08:00), XueBing Chen wrote:
> The strlcpy should not be used because it doesn't limit the source
> length.  Preferred is strscpy.
> 
> 

Applied, thanks!

[1/1] ARM: s3c: Use strscpy to replace strlcpy
      https://git.kernel.org/krzk/linux/c/c241d049122b49698d9094c7ee7a0215fbc04cfe

Best regards,
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;
 }