Bugfix SHA-1 hash comparison

This commit is contained in:
xfarrow 2023-04-19 11:54:00 +02:00 committed by GitHub
parent fee4b98d9f
commit 6c8dbaa976
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -325,7 +325,7 @@ int hash_by_hash_file_comparison(char* filename1, char* filename2)
{
char* hash1 = sha1(filename1);
char* hash2 = sha1(filename2);
int ret = (strcmp(hash1, hash2) == 0);
int ret = (memcmp(hash1, hash2, SHA_DIGEST_LENGTH) == 0);
free(hash1);
free(hash2);
return ret;