mirror of
https://github.com/libgit2/libgit2.git
synced 2026-01-25 02:56:17 +00:00
odb_hash*: accept the oid type to hash into
The git_odb_hash helper functions should not assume SHA1, and instead should be given the oid type that they're producing.
This commit is contained in:
@@ -90,7 +90,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
||||
if (git_indexer_append(indexer, data, size, &stats) < 0)
|
||||
goto cleanup;
|
||||
if (append_hash) {
|
||||
if (git_odb_hash(&oid, data, size, GIT_OBJECT_BLOB) < 0) {
|
||||
if (git_odb_hash(&oid, data, size, GIT_OBJECT_BLOB, GIT_OID_SHA1) < 0) {
|
||||
fprintf(stderr, "Failed to compute the SHA1 hash\n");
|
||||
abort();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user