diff options
author | Rich Gowman <rgowman@google.com> | 2018-06-12 10:50:07 -0400 |
---|---|---|
committer | Rich Gowman <rgowman@google.com> | 2018-06-12 10:50:07 -0400 |
commit | 86cdae83a0b7b36d8a7c61eb3704b28f9f31a041 (patch) | |
tree | bb1dc7167d8eddb9e872780da357026f7ce1d83c /Firestore/Example/FuzzTests/FSTFuzzTestsPrincipal.mm | |
parent | cf2899a085f7ceca3fad2d1fb5336be25cecd7ff (diff) | |
parent | f5bf0a37a7dd40e7538a1aed77af05471b7fe713 (diff) |
Merge remote-tracking branch 'origin/master' into rsgowman/protobuf_cpp
Diffstat (limited to 'Firestore/Example/FuzzTests/FSTFuzzTestsPrincipal.mm')
-rw-r--r-- | Firestore/Example/FuzzTests/FSTFuzzTestsPrincipal.mm | 14 |
1 files changed, 12 insertions, 2 deletions
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<char *>("RunFuzzTestingMain") // First argument is program name. + const_cast<char *>("RunFuzzTestingMain") // First arg is program name. }; char **argv = program_args; int argc = sizeof(program_args) / sizeof(program_args[0]); |