Skip to content

Commit

Permalink
Replace assert by map_grow
Browse files Browse the repository at this point in the history
It will make code prepared for situation when number of solvables
is increased after query is created and applied.

The issue can be easilly triggered by adding remote RPMs therefore
the patch fixes a standard situation

Resolves: https://issues.redhat.com/browse/RHEL-27657
  • Loading branch information
j-mracek authored and m-blaha committed Mar 6, 2024
1 parent 1f30b34 commit ef8ac7f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libdnf/sack/query.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2313,7 +2313,7 @@ Query::Impl::apply()
if (!result)
initResult();
map_init(&m, pool->nsolvables);
assert(m.size == result->getMap()->size);
map_grow(result->getMap(), pool->nsolvables);
for (auto f : filters) {
map_empty(&m);
switch (f.getKeyname()) {
Expand Down

0 comments on commit ef8ac7f

Please sign in to comment.