selftests/bpf: Fix invalid memory reads in core_relo selftest

Another one found by AddressSanitizer. input_len is bigger than actually
initialized data size.

Fixes: c7566a6969 ("selftests/bpf: Add field existence CO-RE relocs tests")
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200429012111.277390-8-andriin@fb.com
This commit is contained in:
Andrii Nakryiko 2020-04-28 18:21:07 -07:00 committed by Alexei Starovoitov
parent 9f56bb531a
commit 13c908495e
1 changed files with 1 additions and 1 deletions

View File

@ -392,7 +392,7 @@ static struct core_reloc_test_case test_cases[] = {
.input = STRUCT_TO_CHAR_PTR(core_reloc_existence___minimal) {
.a = 42,
},
.input_len = sizeof(struct core_reloc_existence),
.input_len = sizeof(struct core_reloc_existence___minimal),
.output = STRUCT_TO_CHAR_PTR(core_reloc_existence_output) {
.a_exists = 1,
.b_exists = 0,