1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-08 10:56:08 +02:00
git/fuzz-pack-headers.c
Josh Steadmon 5e47215080 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>
2018-10-15 14:28:59 +09:00

15 lines
309 B
C

#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;
}