mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 04:04:43 +01:00
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: Douglas Anderson <dianders@chromium.org> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Signed-off-by: Daniel Thompson (RISCstar) <danielt@kernel.org>
This commit is contained in:
parent
8790cc2940
commit
5b26f1a314
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue