MCPcopy Index your code
hub / github.com/git/git / LLVMFuzzerTestOneInput

Function LLVMFuzzerTestOneInput

oss-fuzz/fuzz-commit-graph.c:9–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
8
9int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
10{
11 struct commit_graph *g;
12
13 memset(the_repository, 0, sizeof(*the_repository));
14 initialize_repository(the_repository);
15
16 /*
17 * Initialize the_repository with commit-graph settings that would
18 * normally be read from the repository's gitdir. We want to avoid
19 * touching the disk to keep the individual fuzz-test cases as fast as
20 * possible.
21 */
22 repo_set_hash_algo(the_repository, GIT_HASH_SHA1);
23 the_repository->settings.initialized = 1;
24 the_repository->settings.commit_graph_generation_version = 2;
25 the_repository->settings.commit_graph_changed_paths_version = 1;
26 g = parse_commit_graph(the_repository, (void *)data, size);
27 repo_clear(the_repository);
28 free_commit_graph(g);
29
30 return 0;
31}

Callers

nothing calls this directly

Calls 5

initialize_repositoryFunction · 0.85
repo_set_hash_algoFunction · 0.85
parse_commit_graphFunction · 0.85
repo_clearFunction · 0.85
free_commit_graphFunction · 0.85

Tested by

no test coverage detected