fuzz-commit-graph: initialize repo object
Various #DEFINE "constants" in commit-graph.c now depend on the_hash_algo->rawsz, but this object must be initialized before it can be used. Signed-off-by: Josh Steadmon <steadmon@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Josh Steadmon committed
Feb 7, 2019 at 12:05 UTC
249dc534449f6fabd65894f20ee079fd394ab832
1 file changed
+3
fuzz-commit-graph.c
+3
@@ -1,4 +1,5 @@
1
#include "commit-graph.h"
2
+#include "repository.h"
3
4
struct commit_graph *parse_commit_graph(void *graph_map, int fd,
5
size_t graph_size);
@@ -9,7 +10,9 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
10
{
11
struct commit_graph *g;
12
13
+ initialize_the_repository();
14
g = parse_commit_graph((void *)data, -1, size);
15
+ repo_clear(the_repository);
16
free(g);
17
18
return 0;