xbps-query(8): fix a segfault with '-vL' for local unsigned repositories.

This commit is contained in:
Juan RP 2014-04-13 12:24:26 +02:00
parent b71bda2ba4
commit ed70fe5009
2 changed files with 6 additions and 4 deletions

2
NEWS
View File

@ -1,5 +1,7 @@
xbps-0.36 (???):
* xbps-query(8): fix a segfault with '-vL' for local unsigned repositories.
* xbps-create(8): new option --compression to specify a compression format;
defaults to xz.

View File

@ -156,8 +156,8 @@ list_pkgs_pkgdb(struct xbps_handle *xhp)
static int
repo_list_uri_cb(struct xbps_repo *repo, void *arg _unused, bool *done _unused)
{
const char *signedby, *hexfp;
uint16_t pubkeysize;
const char *signedby = NULL, *hexfp = NULL;
uint16_t pubkeysize = 0;
printf("%5zd %s",
repo->idx ? (ssize_t)xbps_dictionary_count(repo->idx) : -1,
@ -169,8 +169,8 @@ repo_list_uri_cb(struct xbps_repo *repo, void *arg _unused, bool *done _unused)
xbps_dictionary_get_cstring_nocopy(repo->idxmeta, "signature-by", &signedby);
xbps_dictionary_get_uint16(repo->idxmeta, "public-key-size", &pubkeysize);
pubkey = xbps_dictionary_get(repo->idxmeta, "public-key");
if (pubkey)
hexfp = xbps_pubkey2fp(repo->xhp, pubkey);
if (signedby)
printf(" Signed-by: %s\n", signedby);
if (pubkeysize && hexfp)