aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/diveplotdatamodel.cpp
diff options
context:
space:
mode:
authorGravatar Boris Barbulovski <bbarbulovski@gmail.com>2014-02-10 15:59:28 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-02-10 07:55:55 -0800
commite7eb06d78cc695bb598a739325225121c8113610 (patch)
tree7212bd9e5fd89d6ebb5e2b5b1402a397e522b29e /qt-ui/profile/diveplotdatamodel.cpp
parent3e41047d41388002039f8863b35de3b9bfc30888 (diff)
downloadsubsurface-e7eb06d78cc695bb598a739325225121c8113610.tar.gz
Improve sanity check for DivePlotDataModel::data()
Adds DivePlotDataModel row upper-boundary check (isValid method already checks for negative values). Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/diveplotdatamodel.cpp')
-rw-r--r--qt-ui/profile/diveplotdatamodel.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/qt-ui/profile/diveplotdatamodel.cpp b/qt-ui/profile/diveplotdatamodel.cpp
index cb3b07c50..2f81999c2 100644
--- a/qt-ui/profile/diveplotdatamodel.cpp
+++ b/qt-ui/profile/diveplotdatamodel.cpp
@@ -20,7 +20,7 @@ int DivePlotDataModel::columnCount(const QModelIndex& parent) const
QVariant DivePlotDataModel::data(const QModelIndex& index, int role) const
{
- if (!index.isValid())
+ if ((!index.isValid())||(index.row() >= pInfo.nr))
return QVariant();
plot_data item = pInfo.entry[index.row()];