From: Michael Schroeder Date: Thu, 10 Sep 2009 12:10:22 +0000 (+0200) Subject: - be more carful in pool_addfileprovides X-Git-Tag: BASE-SuSE-Code-12_1-Branch~162 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc16d34ecadf4da7d7d56e92f505978a5ff48a53;p=thirdparty%2Flibsolv.git - be more carful in pool_addfileprovides --- diff --git a/src/dirpool.c b/src/dirpool.c index 915e7bc4..afccf504 100644 --- a/src/dirpool.c +++ b/src/dirpool.c @@ -53,6 +53,8 @@ dirpool_add_dir(Dirpool *dp, Id parent, Id comp, int create) if (!dp->ndirs) { + if (!create) + return 0; dp->ndirs = 2; dp->dirs = sat_extend_resize(dp->dirs, dp->ndirs, sizeof(Id), DIR_BLOCK); dp->dirs[0] = 0; diff --git a/src/pool.c b/src/pool.c index 21c52c20..dad0971b 100644 --- a/src/pool.c +++ b/src/pool.c @@ -900,7 +900,7 @@ addfileprovides_cb(void *cbdata, Solvable *s, Repodata *data, Repokey *key, KeyV MAPSET(&cbd->useddirs, did); } } - if (!MAPTST(&cbd->useddirs, value->id)) + if (value->id >= data->dirpool.ndirs || !MAPTST(&cbd->useddirs, value->id)) return 0; for (i = 0; i < cbd->nfiles; i++) { @@ -956,6 +956,7 @@ pool_addfileprovides_search(Pool *pool, struct addfileprovides_cbdata *cbd, stru { if (ndone >= repo->nsolvables) break; + if (!repodata_precheck_keyname(data, SOLVABLE_FILELIST)) continue; for (j = 1; j < data->nkeys; j++) @@ -963,6 +964,7 @@ pool_addfileprovides_search(Pool *pool, struct addfileprovides_cbdata *cbd, stru break; if (j == data->nkeys) continue; + if (repodata_lookup_idarray(data, SOLVID_META, REPOSITORY_ADDEDFILEPROVIDES, &fileprovidesq)) { map_empty(&cbd->providedids); diff --git a/src/repodata.c b/src/repodata.c index 512080b4..8844ea7d 100644 --- a/src/repodata.c +++ b/src/repodata.c @@ -244,7 +244,7 @@ repodata_str2dir(Repodata *data, const char *dir, int create) { if (data->dirpool.ndirs) return 1; - return dirpool_add_dir(&data->dirpool, 0, 1, 1); + return dirpool_add_dir(&data->dirpool, 0, 1, create); } while (*dir) {