xbps-query: fix segfault when listing unexistent package files.

This commit is contained in:
Juan RP 2013-03-13 23:15:42 +01:00
parent b5d141e28c
commit dd9cf9737b
2 changed files with 4 additions and 0 deletions

2
NEWS
View File

@ -1,5 +1,7 @@
xbps-0.22 (???):
* xbps-query(8): fix segfault when showing unexistent package files.
* When checking for obsolete files in upgrades, ignore unexistent files in
current package; this was hitting an assertion due to this.

View File

@ -223,6 +223,8 @@ show_pkg_files(prop_dictionary_t filesd)
for (x = 0; x < prop_array_count(array); x++) {
obj = prop_array_get(array, x);
if (prop_object_type(obj) != PROP_TYPE_DICTIONARY)
continue;
prop_dictionary_get_cstring_nocopy(obj, "file", &file);
printf("%s", file);
if (prop_dictionary_get_cstring_nocopy(obj,