Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/oss-fuzz/fuzz-commit-graph.c # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / oss-fuzz / fuzz-commit-graph.c` 32 lines ยท 988 bytes Raw Blame History 1 #define USE_THE_REPOSITORY_VARIABLE 2 3 #include "git-compat-util.h" 4 #include "commit-graph.h" 5 #include "repository.h" 6 7 int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size); 8 9 int 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->gitdir = xstrdup(".git"); 24 the_repository->settings.initialized = 1; 25 the_repository->settings.commit_graph_generation_version = 2; 26 the_repository->settings.commit_graph_changed_paths_version = 1; 27 g = parse_commit_graph(the_repository, (void *)data, size); 28 repo_clear(the_repository); 29 free_commit_graph(g); 30 31 return 0; 32 }