Skip to content

Commit 249dc53

Browse files
steadmongitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d62dad7 commit 249dc53

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fuzz-commit-graph.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "commit-graph.h"
2+
#include "repository.h"
23

34
struct commit_graph *parse_commit_graph(void *graph_map, int fd,
45
size_t graph_size);
@@ -9,7 +10,9 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
910
{
1011
struct commit_graph *g;
1112

13+
initialize_the_repository();
1214
g = parse_commit_graph((void *)data, -1, size);
15+
repo_clear(the_repository);
1316
free(g);
1417

1518
return 0;

0 commit comments

Comments
 (0)