[Balooshow] Avoid out-of-bounds access when accessing corrupt db data
Summary:
Looping over word without bounds check may cause illegal memory accesses,
potentially crashing balooshow. Add sanity checks for required lengths
and provide feedback in case an error has occured.
Invalid data may occur when the DB has beend corrupted.
Test Plan:
corrupt database
run balooshow -x <file>
Reviewers: Baloo, Frameworks, poboiko
Reviewed By: poboiko
Subscribers: anthonyfieroni, kde-frameworks-devel
Tags: Frameworks, Baloo
Differential Revision: https://phabricator.kde.org/D15826