ARM: s3c: Use strscpy to replace strlcpy
authorJason Wang <wangborong@cdjrlc.com>
Mon, 6 Sep 2021 13:46:56 +0000 (21:46 +0800)
committerKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Mon, 20 Sep 2021 08:13:47 +0000 (10:13 +0200)
The strlcpy should not be used because it doesn't limit the source
length.  Preferred is strscpy.

Signed-off-by: Jason Wang <wangborong@cdjrlc.com>
Link: https://lore.kernel.org/r/20210906134656.101088-1-wangborong@cdjrlc.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
arch/arm/mach-s3c/mach-mini6410.c

index 741fa1f..c14c2e2 100644 (file)
@@ -262,7 +262,7 @@ static char mini6410_features_str[12] __initdata = "0";
 static int __init mini6410_features_setup(char *str)
 {
        if (str)
-               strlcpy(mini6410_features_str, str,
+               strscpy(mini6410_features_str, str,
                        sizeof(mini6410_features_str));
        return 1;
 }