From f5bf0a37a7dd40e7538a1aed77af05471b7fe713 Mon Sep 17 00:00:00 2001 From: Mina Farid Date: Mon, 11 Jun 2018 17:23:07 -0400 Subject: Fuzz testing Header Search Paths settings (#1395) * Modified `HEADER_SEARCH_PATHS` in the project file. --- Firestore/Example/FuzzTests/FSTFuzzTestsPrincipal.mm | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'Firestore/Example/FuzzTests') diff --git a/Firestore/Example/FuzzTests/FSTFuzzTestsPrincipal.mm b/Firestore/Example/FuzzTests/FSTFuzzTestsPrincipal.mm index 63f6db0..038e687 100644 --- a/Firestore/Example/FuzzTests/FSTFuzzTestsPrincipal.mm +++ b/Firestore/Example/FuzzTests/FSTFuzzTestsPrincipal.mm @@ -18,12 +18,22 @@ #include "LibFuzzer/FuzzerDefs.h" +#include "Firestore/core/src/firebase/firestore/remote/serializer.h" + +using firebase::firestore::remote::Serializer; + namespace { +// Fuzz-test the deserialization process in Firestore. The Serializer reads raw +// bytes and converts them to a model object. +void FuzzTestDeserialization(const uint8_t *data, size_t size) { + // TODO(minafarid): fuzz-test Serializer. +} + // Contains the code to be fuzzed. Called by the fuzzing library with // different argument values for `data` and `size`. int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { - // Code to be fuzz-tested here. + FuzzTestDeserialization(data, size); return 0; } @@ -32,7 +42,7 @@ int RunFuzzTestingMain() { // Arguments to libFuzzer main() function should be added to this array, // e.g., dictionaries, corpus, number of runs, jobs, etc. char *program_args[] = { - const_cast("RunFuzzTestingMain") // First argument is program name. + const_cast("RunFuzzTestingMain") // First arg is program name. }; char **argv = program_args; int argc = sizeof(program_args) / sizeof(program_args[0]); -- cgit v1.2.3