]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
fuzz:fuzz_ndr_X: don't skip printing on push error
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Thu, 21 Mar 2024 01:48:34 +0000 (14:48 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 22 Mar 2024 05:03:35 +0000 (05:03 +0000)
push should not have changed the struct, so it is valid to
try to print it also.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
lib/fuzzing/fuzz_ndr_X.c

index d6b7d7c51d9e7b27417b32e2fd22a13be61d3096..9933260841409a7b3e5f57380f7556343dc0aae2 100644 (file)
@@ -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.
+                        */
                }
 
                {