]> git.ipfire.org Git - pakfire.git/commitdiff
file: Don't silently fail if archives should not be hashed
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 7 Feb 2025 23:04:05 +0000 (23:04 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 7 Feb 2025 23:04:05 +0000 (23:04 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/file.c

index 1e1736da5cd69e89f54beb2b84529162fa7a04ee..19014b184e9f59065c4853075f63a46c6bdbea50 100644 (file)
@@ -501,9 +501,11 @@ struct archive_entry* pakfire_file_archive_entry(struct pakfire_file* file, cons
        }
 
        // Compute any required file hashes
-       r = pakfire_file_compute_hashes(file, hashes, &file->hashes);
-       if (r < 0)
-               goto ERROR;
+       if (hashes) {
+               r = pakfire_file_compute_hashes(file, hashes, &file->hashes);
+               if (r < 0)
+                       goto ERROR;
+       }
 
        // SHA-3-512
        if (pakfire_hashes_has(&file->hashes, PAKFIRE_HASH_SHA3_512))