diff options
author | Marius Bugge Monsen <mmonsen@trolltech.com> | 2009-06-22 11:08:46 (GMT) |
---|---|---|
committer | Marius Bugge Monsen <mmonsen@trolltech.com> | 2009-06-22 11:08:46 (GMT) |
commit | 684c43db2b5b0eda94c6893075146fa0e44f2f22 (patch) | |
tree | 80cc39c7c003748e882f50fde941a95a0903f236 | |
parent | 4c515cebc653e44fe6374058b205610592128ea4 (diff) | |
download | Qt-684c43db2b5b0eda94c6893075146fa0e44f2f22.zip Qt-684c43db2b5b0eda94c6893075146fa0e44f2f22.tar.gz Qt-684c43db2b5b0eda94c6893075146fa0e44f2f22.tar.bz2 |
Check if the row larger or equal to the flowPositions vector to prevent out of bounds access.
This problem is encountered if a model doesn't report it's changes correctly.
Reviewed-by: Thierry
Task-number: 256617
-rw-r--r-- | src/gui/itemviews/qlistview.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/itemviews/qlistview.cpp b/src/gui/itemviews/qlistview.cpp index d2fa9a5..d410a57 100644 --- a/src/gui/itemviews/qlistview.cpp +++ b/src/gui/itemviews/qlistview.cpp @@ -2232,7 +2232,7 @@ QListViewItem QStaticListViewBase::indexToListViewItem(const QModelIndex &index) { if (flowPositions.isEmpty() || segmentPositions.isEmpty() - || index.row() > flowPositions.count()) + || index.row() >= flowPositions.count()) return QListViewItem(); const int segment = qBinarySearch<int>(segmentStartRows, index.row(), |