Protect against invalid parents in the IdTreeDB
ClosedPublic

Authored by bruns on Apr 5 2019, 8:28 PM.

Details

Summary

DocumentUrlDB::put is susceptible to invalid parent ids caused by e.g.
renaming while a file/path is added. filePathToId will return 0 for a
(now) invalid dir, although 0 is reserved for the root folder.

As Writetransaction::removeRecursively calls itself for any child document,
having a 0 as child causes infinite recursion.

Test Plan

ctest

Diff Detail

Repository
R293 Baloo
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
bruns created this revision.Apr 5 2019, 8:28 PM
Restricted Application added projects: Frameworks, Baloo. · View Herald TranscriptApr 5 2019, 8:28 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
bruns requested review of this revision.Apr 5 2019, 8:28 PM
bruns added a comment.Apr 5 2019, 8:31 PM

Would be nice to get this into KF 5.57, as this fixes a crash. Sorry, no BRs (none I am aware of).

ngraham accepted this revision.Apr 5 2019, 8:42 PM
This revision is now accepted and ready to land.Apr 5 2019, 8:42 PM
This revision was automatically updated to reflect the committed changes.