]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
sparc: Replace deprecated strcpy() with strscpy() in handle_nextprop_quirks()
authorThorsten Blum <thorsten.blum@linux.dev>
Mon, 22 Sep 2025 21:03:57 +0000 (23:03 +0200)
committerAndreas Larsson <andreas@gaisler.com>
Fri, 26 Sep 2025 15:27:35 +0000 (17:27 +0200)
strcpy() is deprecated; use strscpy() instead.

No functional changes intended.

Link: https://github.com/KSPP/linux/issues/88
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Reviewed-by: Andreas Larsson <andreas@gaisler.com>
Signed-off-by: Andreas Larsson <andreas@gaisler.com>
arch/sparc/kernel/prom_common.c

index c9ec70888a394710fe93c5baede01915b6863c8f..d258fd10db01228e2f082d285a5fc9fee044e249 100644 (file)
@@ -120,11 +120,14 @@ EXPORT_SYMBOL(of_find_in_proplist);
  */
 static int __init handle_nextprop_quirks(char *buf, const char *name)
 {
-       if (!name || strlen(name) == 0)
+       size_t name_len;
+
+       name_len = name ? strlen(name) : 0;
+       if (name_len == 0)
                return -1;
 
 #ifdef CONFIG_SPARC32
-       strcpy(buf, name);
+       strscpy(buf, name, name_len + 1);
 #endif
        return 0;
 }