xbps-pkgdb: fix crash if db file unexistent in 'list' target.
--HG-- extra : convert_revision : a42e5a7eda63a0d121dd7f15683220c84d58b620
This commit is contained in:
parent
6fbb8e0316
commit
f2a77f5e0e
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user