Skip to content

Fix errors in kdescendantproxymodel

Hello,

while I was debugging a crash similar to this bug, I found out it was caused by a mistake in internal data of KDescendantsProxyModel, particularly that its m_mapping's last element didn't correspond to the m_rowCount member.

I reviewed the code, wrote some tests to enhance the testing coverage and fixed all bugs that I found. They are mostly related to violations in QAbstractItemModel contract and omitting the collapsing of some nodes. Unfortunately I don't think these are responsible for the aforementioned crash, so maybe in this case it was the data fed to KDescendantsProxyModel that caused it.

The resulting code was tested by fuzzing with afl++, so I'm pretty confident there shouldn't be serious bugs or crashes.

Please consider applying this as a quality improvement, even though some things should be rewritten completely IMO.

Merge request reports