diff --git a/bin/xbps-pkgdb.c b/bin/xbps-pkgdb.c index 435a567fb5d..0d61482dabe 100644 --- a/bin/xbps-pkgdb.c +++ b/bin/xbps-pkgdb.c @@ -234,6 +234,12 @@ main(int argc, char **argv) usage(); dbdict = prop_dictionary_internalize_from_file(dbfile); + if (dbdict == NULL) { + printf("=> ERROR: cannot read database file (%s)\n", + strerror(errno)); + exit(EINVAL); + } + if (!xbps_callback_array_iter_in_dict(dbdict, "packages", xbps_list_pkgs_in_dict, NULL)) exit(EINVAL);