Handle empty preview lists
ClosedPublic

Authored by cordlandwehr on Sun, Jul 8, 4:29 PM.

Details

Summary

Do not access the first list's element if the list possibly
might be empty.

Diff Detail

Repository
R304 KNewStuff
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
cordlandwehr created this revision.Sun, Jul 8, 4:29 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptSun, Jul 8, 4:29 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
cordlandwehr requested review of this revision.Sun, Jul 8, 4:29 PM

Which bug in which context does this fix? The information given is a bit 'thin' ;-)

I am rather familiar with KMoreTools but not with the rest of KNewStuff.

dhaumann accepted this revision.Sun, Jul 8, 8:30 PM

In any case, this patch will not break things.

This revision is now accepted and ready to land.Sun, Jul 8, 8:30 PM

I had a crash at the respective locations while porting Artikulate to the QtQuick based API, since those KNS resource files do not provide previews.
However, IMO this patch fixes an unsafe access to a list element without checking that it exists.

This revision now requires review to proceed.Sun, Jul 8, 8:32 PM
This revision was not accepted when it landed; it landed in state Needs Review.Thu, Jul 12, 4:43 PM
This revision was automatically updated to reflect the committed changes.

Somehow removed all reviewers with my last message (sorry!)
Trying to fix this now.