mirror of https://github.com/torvalds/linux.git
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:
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';
|
||||
|
|
|
|||
Loading…
Reference in New Issue