linux/kernel/gcov
Hrushiraj Gandhi aabe047f8b 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>
2026-10-06 19:02:59 -07:00
..
base.c
clang.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
fs.c gcov: use strscpy() instead of strcpy() in init_node() 2026-10-06 19:02:59 -07:00
gcc_4_7.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
gcc_base.c
gcov.h
Kconfig
Makefile