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

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

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

We can safely use memcpy() because we already know the length of the
source string 'cp' and that it is guaranteed to be NUL-terminated within
the first KDB_GREP_STRLEN bytes.

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 8790cc29
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -860,7 +860,7 @@ static void parse_grep(const char *str)
		kdb_printf("search string too long\n");
		return;
	}
	strcpy(kdb_grep_string, cp);
	memcpy(kdb_grep_string, cp, len + 1);
	kdb_grepping_flag++;
	return;
}