Fix #30 (segment fault in xbps-rindex)

This commit is contained in:
Juan RP 2014-01-22 11:53:08 +01:00
parent 7f5bd2f8a3
commit c03505b13e
3 changed files with 6 additions and 1 deletions

2
NEWS
View File

@ -1,5 +1,7 @@
xbps-0.30 (??): xbps-0.30 (??):
* Fixed issue #30: https://github.com/voidlinux/xbps/issues/30
* Fixed issue #29: https://github.com/voidlinux/xbps/issues/29 * Fixed issue #29: https://github.com/voidlinux/xbps/issues/29
* Fixed issue #28: https://github.com/voidlinux/xbps/issues/28 * Fixed issue #28: https://github.com/voidlinux/xbps/issues/28

View File

@ -131,7 +131,7 @@ index_clean(struct xbps_handle *xhp, const char *repodir)
idxfiles = xbps_dictionary_copy(repo->idxfiles); idxfiles = xbps_dictionary_copy(repo->idxfiles);
xbps_repo_close(repo); xbps_repo_close(repo);
if (idx == NULL || idxfiles == NULL) { if (idx == NULL || idxfiles == NULL) {
fprintf(stderr, "incomplete repository data file!"); fprintf(stderr, "incomplete repository data file!\n");
return -1; return -1;
} }
printf("Cleaning `%s' index, please wait...\n", repodir); printf("Cleaning `%s' index, please wait...\n", repodir);

View File

@ -65,6 +65,9 @@ repo_get_dict(struct xbps_repo *repo)
size_t size; size_t size;
int rv; int rv;
if (repo->ar == NULL)
return NULL;
rv = archive_read_next_header(repo->ar, &entry); rv = archive_read_next_header(repo->ar, &entry);
if (rv != ARCHIVE_OK) { if (rv != ARCHIVE_OK) {
xbps_dbg_printf(repo->xhp, xbps_dbg_printf(repo->xhp,