From: Klaus Kaempf Date: Tue, 21 Oct 2008 07:13:30 +0000 (+0000) Subject: ensure Pool and Repo are consistent X-Git-Tag: BASE-SuSE-Code-12_1-Branch~434 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6653d8868249b4c19a224d43be51b0b348140fd7;p=platform%2Fupstream%2Flibsolv.git ensure Pool and Repo are consistent --- diff --git a/src/repodata.c b/src/repodata.c index 8e2c88b..71cd5cb 100644 --- a/src/repodata.c +++ b/src/repodata.c @@ -952,11 +952,28 @@ enum { di_entersolvablekey }; +/* see repo.h for documentation */ int dataiterator_init(Dataiterator *di, Pool *pool, Repo *repo, Id p, Id keyname, const char *match, int flags) { memset(di, 0, sizeof(*di)); di->pool = pool; + if (!pool) + { + fprintf(stderr, "dataiterator_init: no Pool given\n"); + di->state = di_bye; + return -1; + } + if (repo) + { + if (repo->pool != pool) + { + fprintf(stderr, "dataiterator_init: repo from different pool\n"); + di->state = di_bye; + return -1; + } + + } if (match) { int error;