]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests/bpf: Use memcpy() for bounded non-NULL-terminated copies
authorIhor Solodrai <ihor.solodrai@linux.dev>
Mon, 23 Feb 2026 19:07:21 +0000 (11:07 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 24 Feb 2026 16:19:49 +0000 (08:19 -0800)
commit9d8685239e85ba5a4899b5b3534c732e3ae5f2aa
tree03e1640652bf88df93e1212e08f1a12f530e8703
parent3ed0bc2d4994c718fb5476b45d4aafec42a1d040
selftests/bpf: Use memcpy() for bounded non-NULL-terminated copies

Replace strncpy() with memcpy() in cases where the source is
non-NULL-terminated and the copy length is known.

Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
Link: https://lore.kernel.org/r/20260223190736.649171-6-ihor.solodrai@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/ctx_rewrite.c
tools/testing/selftests/bpf/test_verifier.c