From aba83a53991e5ba2605a1650a02eb167eb57707b Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Fri, 7 Feb 2025 23:04:05 +0000 Subject: [PATCH] file: Don't silently fail if archives should not be hashed Signed-off-by: Michael Tremer --- src/pakfire/file.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/pakfire/file.c b/src/pakfire/file.c index 1e1736da..19014b18 100644 --- a/src/pakfire/file.c +++ b/src/pakfire/file.c @@ -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)) -- 2.39.5