From c4ed1b584596829c43bc31868ea9ec01736e0667 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Thu, 28 May 2015 09:44:01 +0200 Subject: [PATCH] xbps-pkgdb: if pkg metafile cannot be internalized print a proper errmsg. --- bin/xbps-pkgdb/check.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/xbps-pkgdb/check.c b/bin/xbps-pkgdb/check.c index ccda3b13..8477afbe 100644 --- a/bin/xbps-pkgdb/check.c +++ b/bin/xbps-pkgdb/check.c @@ -96,7 +96,12 @@ check_pkg_integrity(struct xbps_handle *xhp, xhp->metadir, pkgname); assert(buf); filesd = xbps_dictionary_internalize_from_zfile(buf); - assert(filesd); + if (filesd == NULL) { + fprintf(stderr, "%s: cannot read %s, ignoring...\n", + pkgname, buf); + free(buf); + return -1; + } rv = xbps_file_hash_check(buf, sha256); free(buf); if (rv == ENOENT) {