[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [libqapt] src: Prevent trying to access .at() with a negative number
From:       Jonathan Thomas <echidnaman () kubuntu ! org>
Date:       2011-08-31 23:34:10
Message-ID: 20110831233410.C44C5A6078 () git ! kde ! org
[Download RAW message or body]

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');

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic