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>
This commit is contained in:

committed by
Junio C Hamano

parent
2efbb7f521
commit
5e47215080
14
fuzz-pack-headers.c
Normal file
14
fuzz-pack-headers.c
Normal file
@ -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;
|
||||
}
|
Reference in New Issue
Block a user