diff options
Diffstat (limited to 'fuzzers/commit_graph_fuzzer.c')
-rw-r--r-- | fuzzers/commit_graph_fuzzer.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fuzzers/commit_graph_fuzzer.c b/fuzzers/commit_graph_fuzzer.c index f5b9c8988..eb2c38258 100644 --- a/fuzzers/commit_graph_fuzzer.c +++ b/fuzzers/commit_graph_fuzzer.c @@ -32,6 +32,7 @@ int LLVMFuzzerInitialize(int *argc, char ***argv) int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { git_commit_graph_file cgraph = {{0}}; + git_commit_graph_entry e; git_buf commit_graph_buf = GIT_BUF_INIT; git_oid oid = {{0}}; bool append_hash = false; @@ -68,6 +69,10 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) < 0) goto cleanup; + /* Search for any oid, just to exercise that codepath. */ + if (git_commit_graph_entry_find(&e, &cgraph, &oid, GIT_OID_HEXSZ) < 0) + goto cleanup; + cleanup: git_commit_graph_close(&cgraph); git_buf_dispose(&commit_graph_buf); |