ref: refs/heads/master
commit dcc2c6bc39fd8e1784337a9ea65832952c6a59fb
Author: Michael Schroeder
Date: Thu Sep 10 14:10:22 2009 +0200
- be more carful in pool_addfileprovides
---
src/dirpool.c | 2 ++
src/pool.c | 4 +++-
src/repodata.c | 2 +-
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/dirpool.c b/src/dirpool.c
index 915e7bc..afccf50 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 21c52c2..dad0971 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 512080b..8844ea7 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)
{
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org