Commit d4be3238 authored by Thorsten Blum's avatar Thorsten Blum Committed by Daniel Thompson (RISCstar)
Browse files

kdb: Replace deprecated strcpy() with memcpy() in kdb_strdup()

strcpy() is deprecated; use memcpy() instead.

Link: https://github.com/KSPP/linux/issues/88


Reviewed-by: default avatarDouglas Anderson <dianders@chromium.org>
Signed-off-by: default avatarThorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: default avatarDaniel Thompson (RISCstar) <danielt@kernel.org>
parent 05c81edd
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@
#include <linux/uaccess.h>
#include <linux/kdb.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/ctype.h>
#include "kdb_private.h"

@@ -246,11 +247,12 @@ void kdb_symbol_print(unsigned long addr, const kdb_symtab_t *symtab_p,
 */
char *kdb_strdup(const char *str, gfp_t type)
{
	int n = strlen(str)+1;
	size_t n = strlen(str) + 1;
	char *s = kmalloc(n, type);
	if (!s)
		return NULL;
	return strcpy(s, str);
	memcpy(s, str, n);
	return s;
}

/*