From: Michael Schroeder Date: Tue, 18 Sep 2018 12:00:38 +0000 (+0200) Subject: repo_add_solv: check that arrays have incore storage X-Git-Tag: 0.7.0~45 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=707f60e8b5c388129ce4287cfb8d298c2913f892;p=thirdparty%2Flibsolv.git repo_add_solv: check that arrays have incore storage Also fix a tiny bug in the vdata handling. --- diff --git a/src/repo_solv.c b/src/repo_solv.c index d56b4e77..feb7f33e 100644 --- a/src/repo_solv.c +++ b/src/repo_solv.c @@ -879,6 +879,8 @@ repo_add_solv(Repo *repo, FILE *fp, int flags) data.error = pool_error(pool, SOLV_ERROR_UNSUPPORTED, "main solvable data must use incore storage %d", keys[i].storage); keys[i].storage = KEY_STORAGE_SOLVABLE; } + if ((type == REPOKEY_TYPE_FIXARRAY || type == REPOKEY_TYPE_FLEXARRAY) && keys[i].storage != KEY_STORAGE_INCORE) + data.error = pool_error(pool, SOLV_ERROR_UNSUPPORTED, "flex/fixarrays must use incore storage\n"); /* cannot handle rel idarrays in incore/vertical */ if (type == REPOKEY_TYPE_REL_IDARRAY && keys[i].storage != KEY_STORAGE_SOLVABLE) data.error = pool_error(pool, SOLV_ERROR_UNSUPPORTED, "type REL_IDARRAY is only supported for STORAGE_SOLVABLE"); @@ -1270,7 +1272,7 @@ printf("=> %s %s %p\n", pool_id2str(pool, keys[key].name), pool_id2str(pool, key keys[i].type = REPOKEY_TYPE_IDARRAY; for (i = 1; i < numkeys; i++) - if (keys[i].storage == KEY_STORAGE_VERTICAL_OFFSET) + if (keys[i].storage == KEY_STORAGE_VERTICAL_OFFSET && keys[i].size) break; if (i < numkeys && !data.error) {