diff options
author | Michael Schroeder <mls@suse.de> | 2014-02-21 15:13:54 +0100 |
---|---|---|
committer | Michael Schroeder <mls@suse.de> | 2014-02-21 15:13:54 +0100 |
commit | e247bf87b38f3230c58cee589684cee4b623a246 (patch) | |
tree | 8310d1036c253bb235985a51c2f03c71cae6a033 /src/rules.c | |
parent | f9935ae50419d422b176923497e92016f7c18c19 (diff) | |
download | libsolv-e247bf87b38f3230c58cee589684cee4b623a246.tar.gz libsolv-e247bf87b38f3230c58cee589684cee4b623a246.tar.bz2 libsolv-e247bf87b38f3230c58cee589684cee4b623a246.zip |
fix bug in solver_get_unneeded that could lead to an endless loop
Diffstat (limited to 'src/rules.c')
-rw-r--r-- | src/rules.c | 6 |
1 files 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); |