Commit f8821405773d76025a29563f7b263a2b9b558572

Edward Thomson 2022-01-27T15:19:09

fuzzer: use raw oid data The indexer expects raw oid data, provide it.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/fuzzers/packfile_fuzzer.c b/fuzzers/packfile_fuzzer.c
index 6002fa1..23ecaf8 100644
--- a/fuzzers/packfile_fuzzer.c
+++ b/fuzzers/packfile_fuzzer.c
@@ -94,7 +94,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
 			fprintf(stderr, "Failed to compute the SHA1 hash\n");
 			abort();
 		}
-		if (git_indexer_append(indexer, &oid, sizeof(oid), &stats) < 0) {
+		if (git_indexer_append(indexer, &oid.id, GIT_OID_RAWSZ, &stats) < 0) {
 			goto cleanup;
 		}
 	}