Skip to content

Commit 781ba69

Browse files
pks-tgitster
authored andcommitted
oss-fuzz/commit-graph: set up hash algorithm
Our fuzzing setups don't work in a proper repository, but only use the in-memory configured `the_repository`. Consequently, we never go through the full repository setup procedures and thus do not set up the hash algo used by the repository. The commit-graph fuzzer does rely on a properly initialized hash algo though. Initialize it explicitly. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 373bfa6 commit 781ba69

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

oss-fuzz/fuzz-commit-graph.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
1919
* touching the disk to keep the individual fuzz-test cases as fast as
2020
* possible.
2121
*/
22+
repo_set_hash_algo(the_repository, GIT_HASH_SHA1);
2223
the_repository->settings.commit_graph_generation_version = 2;
2324
the_repository->settings.commit_graph_read_changed_paths = 1;
2425
g = parse_commit_graph(&the_repository->settings, (void *)data, size);

0 commit comments

Comments
 (0)