]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib/fuzzing: Also confirm we can make a string filter from the parsed tree in fuzz_ld...
authorAndrew Bartlett <abartlet@samba.org>
Wed, 4 Dec 2019 09:07:26 +0000 (22:07 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 10 Dec 2019 07:50:28 +0000 (07:50 +0000)
This also avoids tree being an unused variable.

This is similar to doing an ndr_push() in ndr_fuzz_X, it
catches some of the cases where the parse is successful but
the application code could misinterpret the structure.

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

index f0f021481422fff7d84a223843c9dbd61a1f1686..bbcdeab2e67c039892112cdf05776f354f1f898e 100644 (file)
@@ -44,6 +44,8 @@ int LLVMFuzzerTestOneInput(uint8_t *buf, size_t len)
 
        tree = ldb_parse_tree(mem_ctx, filter);
 
+       (void)ldb_filter_from_tree(tree, mem_ctx);
+
        talloc_free(mem_ctx);
 
        return 0;