Skip to content

Commit

Permalink
selftests/bpf: Fix use of uninitialized op_name in log tests
Browse files Browse the repository at this point in the history
One of the test assertions uses an uninitialized op_name, which leads
to some headscratching if it fails. Use a string constant instead.

Fixes: b1a7a48 ("selftests/bpf: Add fixed vs rotating verifier log tests")
Signed-off-by: Lorenz Bauer <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
  • Loading branch information
lmb authored and borkmann committed Apr 13, 2023
1 parent d319f34 commit 5a67461
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/testing/selftests/bpf/prog_tests/verifier_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ static void verif_log_subtest(const char *name, bool expect_load_error, int log_
}
if (!ASSERT_EQ(strlen(logs.buf), 24, "log_fixed_25"))
goto cleanup;
if (!ASSERT_STRNEQ(logs.buf, logs.reference, 24, op_name))
if (!ASSERT_STRNEQ(logs.buf, logs.reference, 24, "log_fixed_contents_25"))
goto cleanup;
}

Expand Down

0 comments on commit 5a67461

Please sign in to comment.