Author: mlschroe Date: Mon Oct 22 20:50:33 2007 New Revision: 7600 URL: http://svn.opensuse.org/viewcvs/zypp?rev=7600&view=rev Log: - fix idarray overflow checking - do not create weak rule for packages scheduled for removal (fixes one testcase) - fix some explanations in README.FAILS Modified: trunk/sat-solver/src/solver.c trunk/sat-solver/src/source_solv.c trunk/sat-solver/testsuite/README.FAILS Modified: trunk/sat-solver/src/solver.c URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/src/solver.c?rev=7600&r1=7599&r2=7600&view=diff ============================================================================== --- trunk/sat-solver/src/solver.c (original) +++ trunk/sat-solver/src/solver.c Mon Oct 22 20:50:33 2007 @@ -2789,6 +2789,8 @@ solv->weaksystemrules = xcalloc(solv->system->nsolvables, sizeof(Id)); for (i = 0; i < solv->system->nsolvables; i++) { + if (MAPTST(&noupdaterule, solv->system->start + i)) + continue; findupdatepackages(solv, pool->solvables + solv->system->start + i, &q, (Map *)0, 1, 1); if (q.count) solv->weaksystemrules[i] = pool_queuetowhatprovides(pool, &q); Modified: trunk/sat-solver/src/source_solv.c URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/src/source_solv.c?rev=7600&r1=7599&r2=7600&view=diff ============================================================================== --- trunk/sat-solver/src/source_solv.c (original) +++ trunk/sat-solver/src/source_solv.c Mon Oct 22 20:50:33 2007 @@ -107,7 +107,7 @@ */ static Id * -read_idarray(FILE *fp, Id max, Id *map, Id *store) +read_idarray(FILE *fp, Id max, Id *map, Id *store, Id *end) { unsigned int x = 0; int c; @@ -122,9 +122,24 @@ if ((c & 128) == 0) { x = (x << 6) | (c & 63); + if (x >= max) + { + fprintf(stderr, "read_idarray: id too large (%u/%u)\n", x, max); + exit(1); + } + if (store == end) + { + fprintf(stderr, "read_idarray: array overflow\n"); + exit(1); + } *store++ = map[x]; if ((c & 64) == 0) { + if (store == end) + { + fprintf(stderr, "read_idarray: array overflow\n"); + exit(1); + } *store++ = 0; return store; } @@ -173,7 +188,7 @@ SolvData *solvdata; unsigned int size, size_str, size_idarray; Source *source; - Id *idarraydatap, *ida; + Id *idarraydatap, *idarraydataend, *ida; unsigned int databits; Solvable *s; @@ -466,6 +481,7 @@ source->idarraydata = (Id *)xmalloc(sizeof(Id) * size_idarray); source->idarraysize = size_idarray; idarraydatap = source->idarraydata; + idarraydataend = source->idarraydata + size_idarray; /* alloc solvables */ pool->solvables = (Solvable *)xrealloc(pool->solvables, (pool->nsolvables + numsolv) * sizeof(Solvable)); @@ -544,7 +560,7 @@ break; } ida = idarraydatap; - idarraydatap = read_idarray(fp, numid + numrel, idmap, ida); + idarraydatap = read_idarray(fp, numid + numrel, idmap, ida, idarraydataend); if (id == SOLVABLE_PROVIDES) s->provides = ida; else if (id == SOLVABLE_OBSOLETES) Modified: trunk/sat-solver/testsuite/README.FAILS URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/testsuite/README.FAILS?rev=7600&r1=7599&r2=7600&view=diff ============================================================================== --- trunk/sat-solver/testsuite/README.FAILS (original) +++ trunk/sat-solver/testsuite/README.FAILS Mon Oct 22 20:50:33 2007 @@ -8,6 +8,9 @@ installs recommends ./data.libzypp/yast-tests/exercise-02conflict-12-test.xml + very strange testcase, has two identical versions of requirerer2 + installed and tests that the solver replaces just one, which + is actually impossible ./data.libzypp/kernel-tests/kernel_kmp-test.xml libzypp does an upgrade of a package needed, mls prefers not to @@ -17,22 +20,20 @@ ./data.libzypp/yast-tests/exercise-02conflict-09-test.xml libzypp removes broken pack, mls changes version -./data.libzypp/yast-tests/exercise-06upgrade-test.xml - p7new is obsoleting p7, but in that case libzypp does not install it - ./data.libzypp/basic-exercises/exercise-25-test.xml ./data.libzypp/basic-exercises/exercise-26-test.xml - promotecho is only enabled for redcarpet + promoteepoch is only enabled for redcarpet ./data.libzypp/lock-tests/install-single-test.xml lock should be broken by a install (possibly not a solver bug) # BUGS ./data.libzypp/bugzilla-tests/bug310618-test.xml - sat-solver does not like it + sat-solver used to not like it, now it's just different ./data.libzypp/bugzilla-tests/bug328081-test.xml bundle-lang-common-ko is pretty much unneeded + caused by inconsistent locale()/language mapping # MISSINGS ./data.libzypp/bugzilla-tests/bug308252-test.xml -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org