Skip to content

Commit 8f6399e

Browse files
committed
Merge branch 'js/fuzz-commit-graph-update'
Update to the fuzzer. * js/fuzz-commit-graph-update: object: fix leak of shallow_stat fuzz-commit-graph: initialize repo object
2 parents ca9103d + 96b0710 commit 8f6399e

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-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;

object.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,9 +557,11 @@ void parsed_object_pool_clear(struct parsed_object_pool *o)
557557
clear_alloc_state(o->commit_state);
558558
clear_alloc_state(o->tag_state);
559559
clear_alloc_state(o->object_state);
560+
stat_validity_clear(o->shallow_stat);
560561
FREE_AND_NULL(o->blob_state);
561562
FREE_AND_NULL(o->tree_state);
562563
FREE_AND_NULL(o->commit_state);
563564
FREE_AND_NULL(o->tag_state);
564565
FREE_AND_NULL(o->object_state);
566+
FREE_AND_NULL(o->shallow_stat);
565567
}

0 commit comments

Comments
 (0)