OSDN Git Service

selftests/bpf: Fix possible NULL passed to memcpy() with zero size
authorAndrii Nakryiko <andrii@kernel.org>
Wed, 24 Nov 2021 00:23:20 +0000 (16:23 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 25 Nov 2021 23:15:03 +0000 (00:15 +0100)
commit3bd0233f388e061c44d36a1ac614a3bb4a851b7e
treedac7834cbccc83310aa9c8a2d15b42f4c296ead2
parent486e648cb2f170702fc05f777c7b6b3d8ec662ce
selftests/bpf: Fix possible NULL passed to memcpy() with zero size

Prevent sanitizer from complaining about passing NULL into memcpy(),
even if it happens with zero size.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20211124002325.1737739-9-andrii@kernel.org
tools/testing/selftests/bpf/prog_tests/core_reloc.c