xbps-pkgdb: fix crash if db file unexistent in 'list' target.
--HG-- extra : convert_revision : a42e5a7eda63a0d121dd7f15683220c84d58b620
This commit is contained in:
@@ -234,6 +234,12 @@ main(int argc, char **argv)
|
|||||||
usage();
|
usage();
|
||||||
|
|
||||||
dbdict = prop_dictionary_internalize_from_file(dbfile);
|
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,
|
if (!xbps_callback_array_iter_in_dict(dbdict,
|
||||||
"packages", xbps_list_pkgs_in_dict, NULL))
|
"packages", xbps_list_pkgs_in_dict, NULL))
|
||||||
exit(EINVAL);
|
exit(EINVAL);
|
||||||
|
|||||||
Reference in New Issue
Block a user