sparc: Replace deprecated strcpy() with strscpy() in handle_nextprop_quirks()

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>
This commit is contained in:
Thorsten Blum 2025-09-22 23:03:57 +02:00 committed by Andreas Larsson
parent 79f76dfb4e
commit fe0126702a
1 changed files with 5 additions and 2 deletions

View File

@ -120,11 +120,14 @@ EXPORT_SYMBOL(of_find_in_proplist);
*/ */
static int __init handle_nextprop_quirks(char *buf, const char *name) 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; return -1;
#ifdef CONFIG_SPARC32 #ifdef CONFIG_SPARC32
strcpy(buf, name); strscpy(buf, name, name_len + 1);
#endif #endif
return 0; return 0;
} }