From e247bf87b38f3230c58cee589684cee4b623a246 Mon Sep 17 00:00:00 2001 From: Michael Schroeder Date: Fri, 21 Feb 2014 15:13:54 +0100 Subject: [PATCH] fix bug in solver_get_unneeded that could lead to an endless loop --- src/rules.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rules.c b/src/rules.c index 8ac1d73..dad682f 100644 --- a/src/rules.c +++ b/src/rules.c @@ -3905,8 +3905,8 @@ solver_get_unneeded(Solver *solv, Queue *unneededq, int filtered) /* now add edge from j + 1 to i + 1 */ queue_insert(&edges, edges.elements[j + 1] + nrequires[j], i + 1); /* addapt following edge pointers */ - for (k = j + 2; k < count + 2; k++) - edges.elements[k]++; + for (j = j + 2; j < count + 1; j++) + edges.elements[j]++; } queue_free(&iq); } @@ -3921,7 +3921,7 @@ solver_get_unneeded(Solver *solv, Queue *unneededq, int filtered) printf(" %s (%d requires):\n", pool_solvid2str(pool, unneededq->elements[i]), nrequires[i]); for (j = edges.elements[i + 1]; edges.elements[j]; j++) printf(" - %s\n", pool_solvid2str(pool, unneededq->elements[edges.elements[j] - 1])); - } + } #endif map_free(&installedm); -- 2.7.4