From kde-commits Wed Aug 31 23:34:10 2011 From: Jonathan Thomas Date: Wed, 31 Aug 2011 23:34:10 +0000 To: kde-commits Subject: [libqapt] src: Prevent trying to access .at() with a negative number Message-Id: <20110831233410.C44C5A6078 () git ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=131483366901121 Git commit 0807aee527c73152d1431fcc5797f27ae4e67914 by Jonathan Thomas. Committed on 01/09/2011 at 01:33. Pushed by jmthomas into branch 'master'. Prevent trying to access .at() with a negative number M +3 -0 src/changelog.cpp http://commits.kde.org/libqapt/0807aee527c73152d1431fcc5797f27ae4e67914 diff --git a/src/changelog.cpp b/src/changelog.cpp index d4a78c3..b4bf5b7 100644 --- a/src/changelog.cpp +++ b/src/changelog.cpp @@ -208,6 +208,9 @@ ChangelogEntryList Changelog::entries() const } int curIndex = entryTexts.count() -1; + if (curIndex < 0) { + continue; + } QString curEntry = entryTexts.at(curIndex); curEntry.append(line % '\n');