commit b808e01085d775b284878dfeea5c06339a9f2ec2 from: Ted Unangst date: Mon May 06 01:47:01 2024 UTC abort if we see a sha2 hash. it's incomplete and will lead to an overwrite. quiets a potential compiler warning. commit - 24fa9165db013fd2fcf6c5161d9167fcd42e317d commit + b808e01085d775b284878dfeea5c06339a9f2ec2 blob - 20b361d7668e783af7ab8170c7386a21faf20307 blob + daa3516614f132aef1e370991d07c4c3699dc955 --- lib/hash.c +++ lib/hash.c @@ -205,7 +205,10 @@ void got_hash_final_object_id(struct got_hash *hash, struct got_object_id *id) { memset(id, 0, sizeof(*id)); - got_hash_final(hash, id->sha1); + if (hash->algo == GOT_HASH_SHA1) + SHA1Final(id->sha1, &hash->sha1_ctx); + else + abort(); } int