Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/bpf: Fix use of uninitialized op_name in log tests

One of the test assertions uses an uninitialized op_name, which leads
to some headscratching if it fails. Use a string constant instead.

Fixes: b1a7a480a112 ("selftests/bpf: Add fixed vs rotating verifier log tests")
Signed-off-by: Lorenz Bauer <lmb@isovalent.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20230413094740.18041-1-lmb@isovalent.com

authored by

Lorenz Bauer and committed by
Daniel Borkmann
5a674611 d319f344

+1 -1
+1 -1
tools/testing/selftests/bpf/prog_tests/verifier_log.c
··· 110 110 } 111 111 if (!ASSERT_EQ(strlen(logs.buf), 24, "log_fixed_25")) 112 112 goto cleanup; 113 - if (!ASSERT_STRNEQ(logs.buf, logs.reference, 24, op_name)) 113 + if (!ASSERT_STRNEQ(logs.buf, logs.reference, 24, "log_fixed_contents_25")) 114 114 goto cleanup; 115 115 } 116 116