This buffer is passed to landlock_create_ruleset() a bit further down, expecting an ENOMSG error. This is only guaranteed when the buffer is zero-initialized.
Assisted-by: LLM Signed-off-by: Günther Noack <[email protected]> --- tools/testing/selftests/landlock/base_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/landlock/base_test.c b/tools/testing/selftests/landlock/base_test.c index d20ab8f0862c..4e83f9c52a6f 100644 --- a/tools/testing/selftests/landlock/base_test.c +++ b/tools/testing/selftests/landlock/base_test.c @@ -25,7 +25,7 @@ TEST(inconsistent_attr) { const long page_size = sysconf(_SC_PAGESIZE); - char *const buf = malloc(page_size + 1); + char *const buf = calloc(1, page_size + 1); struct landlock_ruleset_attr *const ruleset_attr = (void *)buf; ASSERT_NE(NULL, buf); -- 2.56.0

