summaryrefslogtreecommitdiff
path: root/fuzzers
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2022-01-22 23:10:03 -0500
committerEdward Thomson <ethomson@edwardthomson.com>2022-06-14 22:29:57 -0400
commitdbc4ac1c76827e954e0aa27afe8bb7e0b8993a93 (patch)
tree56f18a11bca8d17490a176cddf9e3756c2cebe91 /fuzzers
parentf98dd5438f8d7bfd557b612fdf1605b1c3fb8eaf (diff)
downloadlibgit2-dbc4ac1c76827e954e0aa27afe8bb7e0b8993a93.tar.gz
oid: `GIT_OID_*SZ` is now `GIT_OID_SHA1_*SIZE`
In preparation for SHA256 support, `GIT_OID_RAWSZ` and `GIT_OID_HEXSZ` need to indicate that they're the size of _SHA1_ OIDs.
Diffstat (limited to 'fuzzers')
-rw-r--r--fuzzers/commit_graph_fuzzer.c4
-rw-r--r--fuzzers/midx_fuzzer.c4
-rw-r--r--fuzzers/packfile_fuzzer.c2
3 files changed, 5 insertions, 5 deletions
diff --git a/fuzzers/commit_graph_fuzzer.c b/fuzzers/commit_graph_fuzzer.c
index 1c46d78c7..f037801cf 100644
--- a/fuzzers/commit_graph_fuzzer.c
+++ b/fuzzers/commit_graph_fuzzer.c
@@ -62,7 +62,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
memcpy(commit_graph_buf.ptr, data, size);
memcpy(commit_graph_buf.ptr + size, hash, GIT_HASH_SHA1_SIZE);
- memcpy(oid.id, hash, GIT_OID_RAWSZ);
+ memcpy(oid.id, hash, GIT_OID_SHA1_SIZE);
} else {
git_str_attach_notowned(&commit_graph_buf, (char *)data, size);
}
@@ -75,7 +75,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
goto cleanup;
/* Search for any oid, just to exercise that codepath. */
- if (git_commit_graph_entry_find(&e, &file, &oid, GIT_OID_HEXSZ) < 0)
+ if (git_commit_graph_entry_find(&e, &file, &oid, GIT_OID_SHA1_HEXSIZE) < 0)
goto cleanup;
cleanup:
diff --git a/fuzzers/midx_fuzzer.c b/fuzzers/midx_fuzzer.c
index 4c3124e47..8cd1102a6 100644
--- a/fuzzers/midx_fuzzer.c
+++ b/fuzzers/midx_fuzzer.c
@@ -61,7 +61,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
memcpy(midx_buf.ptr, data, size);
memcpy(midx_buf.ptr + size, hash, GIT_HASH_SHA1_SIZE);
- memcpy(oid.id, hash, GIT_OID_RAWSZ);
+ memcpy(oid.id, hash, GIT_OID_SHA1_SIZE);
} else {
git_str_attach_notowned(&midx_buf, (char *)data, size);
}
@@ -70,7 +70,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
goto cleanup;
/* Search for any oid, just to exercise that codepath. */
- if (git_midx_entry_find(&e, &idx, &oid, GIT_OID_HEXSZ) < 0)
+ if (git_midx_entry_find(&e, &idx, &oid, GIT_OID_SHA1_HEXSIZE) < 0)
goto cleanup;
cleanup:
diff --git a/fuzzers/packfile_fuzzer.c b/fuzzers/packfile_fuzzer.c
index 23ecaf80f..7f448f6a4 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.id, GIT_OID_RAWSZ, &stats) < 0) {
+ if (git_indexer_append(indexer, &oid.id, GIT_OID_SHA1_SIZE, &stats) < 0) {
goto cleanup;
}
}