diff options
| author | Hrushiraj Gandhi <hrushirajg23@gmail.com> | 2026-08-31 20:19:53 +0530 |
|---|---|---|
| committer | Andrew Morton <akpm@linux-foundation.org> | 2026-10-06 19:02:59 -0700 |
| commit | aabe047f8b8055b66cf55a88c688c6660a3f6aca (patch) | |
| tree | 3fd2dd59bd83445d981623b4f971cd06ebf66a57 /include/linux | |
| parent | b82cf9e49c1be7cf1fd8e1bd806b0cdd25ab8127 (diff) | |
gcov: use strscpy() instead of strcpy() in init_node()
node->name is a flexible array member sized to exactly strlen(name) + 1
bytes at allocation time in new_node(), so this copy can never actually
overflow. Still, prefer the bounded strscpy() over strcpy() on general
principle; pass the same strlen(name) + 1 bound the allocation used, since
sizeof() cannot be applied to a flexible array member.
No functional change.
Link: https://lore.kernel.org/20260831144953.324441-1-hrushirajg23@gmail.com
Signed-off-by: Hrushiraj Gandhi <hrushirajg23@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Bradley Morgan <brads@mainlining.org>
Cc: Peter Oberparleiter <oberpar@linux.ibm.com>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions
