mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-27 10:01:39 -05:00
MIPS: Loongson2ef: Replace deprecated strncpy() with strscpy()
strncpy() is deprecated for NUL-terminated destination buffers. Use strscpy() instead and remove the manual NUL-termination. Compile-tested only. Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
This commit is contained in:
committed by
Thomas Bogendoerfer
parent
232085d118
commit
1bea9ab46d
@@ -48,8 +48,7 @@ void __init prom_init_machtype(void)
|
||||
return;
|
||||
}
|
||||
p += strlen("machtype=");
|
||||
strncpy(str, p, MACHTYPE_LEN);
|
||||
str[MACHTYPE_LEN] = '\0';
|
||||
strscpy(str, p);
|
||||
p = strstr(str, " ");
|
||||
if (p)
|
||||
*p = '\0';
|
||||
|
||||
Reference in New Issue
Block a user