Skip to content

fix (again) corruption condition in the hostdb

David Vorick requested to merge hostdb-fix-2 into master

There was a problem in the hostdb previously where the host tree would corrupt after a scan because the weight would change but the tree would not restructure to account for the change in the weight.

That bug was supposed to be fixed by re-adding the node to the tree after the change. But, it was an insufficient move due to the pointer unsafety of the tree. Adding the node again is prefixed by a call to remove the existing entry. The existing entry however has a different weight than when it was inserted, causing corruption upon removal.

This change is not tested, tests to follow in future commits.

Merge request reports