Skip to content

Commit 0ecd4f3

Browse files
committed
Fix segfault in resolve_jobrules
In selectandinstall sometimes rules are added and a realloc is required if there's no more memory available in the allocated block. r-- would just decrement the old pointer but the realloc could return a completely different block of memory
1 parent 35e172e commit 0ecd4f3

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/solver.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1629,6 +1629,7 @@ resolve_jobrules(Solver *solv, int level, int disablerules, Queue *dq)
16291629
}
16301630
olevel = level;
16311631
level = selectandinstall(solv, level, dq, disablerules, i, SOLVER_REASON_RESOLVE_JOB);
1632+
r = solv->rules + i; /* selectandinstall may have added more rules */
16321633
if (level <= olevel)
16331634
{
16341635
if (level == olevel)

0 commit comments

Comments
 (0)