diff options
author | Josh Steadmon <steadmon@google.com> | 2018-10-13 02:58:40 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-10-15 07:28:59 +0200 |
commit | 5e47215080018b7eea2054ec70f5d686715d66ee (patch) | |
tree | 70f2a6f4c79a0a36855050df84dbcdbe554a3a7c /fuzz-pack-headers.c | |
parent | Declare that the next one will be named 2.20 (diff) | |
download | git-5e47215080018b7eea2054ec70f5d686715d66ee.tar.xz git-5e47215080018b7eea2054ec70f5d686715d66ee.zip |
fuzz: add basic fuzz testing target.
fuzz-pack-headers.c provides a fuzzing entry point compatible with
libFuzzer (and possibly other fuzzing engines).
Signed-off-by: Josh Steadmon <steadmon@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'fuzz-pack-headers.c')
-rw-r--r-- | fuzz-pack-headers.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/fuzz-pack-headers.c b/fuzz-pack-headers.c new file mode 100644 index 0000000000..99da1d0fd3 --- /dev/null +++ b/fuzz-pack-headers.c @@ -0,0 +1,14 @@ +#include "packfile.h" + +int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size); + +int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) +{ + enum object_type type; + unsigned long len; + + unpack_object_header_buffer((const unsigned char *)data, + (unsigned long)size, &type, &len); + + return 0; +} |