diff --git a/lib/util_hash.c b/lib/util_hash.c index f13f1b0e..0e62d45e 100644 --- a/lib/util_hash.c +++ b/lib/util_hash.c @@ -125,6 +125,8 @@ xbps_file_hash_raw(const char *file) SHA256_Update(&sha256, buf, len); SHA256_Final(digest, &sha256); close(fd); + if(len < 0) + return NULL; return digest; }