From 842e7378439fcf354260c98b9ea7dadf59c601c7 Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Thu, 21 Mar 2024 14:48:34 +1300 Subject: [PATCH] fuzz:fuzz_ndr_X: don't skip printing on push error push should not have changed the struct, so it is valid to try to print it also. Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- lib/fuzzing/fuzz_ndr_X.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/fuzzing/fuzz_ndr_X.c b/lib/fuzzing/fuzz_ndr_X.c index d6b7d7c51d9..99332608414 100644 --- a/lib/fuzzing/fuzz_ndr_X.c +++ b/lib/fuzzing/fuzz_ndr_X.c @@ -312,8 +312,14 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { pull_push_print_flags, st); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - TALLOC_FREE(mem_ctx); - return 0; + /* + * Note we aren't bailing here. + * + * It is good that ndr_push returned an error, because + * the structure is no doubt rubbish. But that doesn't + * mean we don't also want to see if ndr_print can + * handle it. + */ } { -- 2.34.1