From e7eb06d78cc695bb598a739325225121c8113610 Mon Sep 17 00:00:00 2001 From: Boris Barbulovski Date: Mon, 10 Feb 2014 15:59:28 +0100 Subject: Improve sanity check for DivePlotDataModel::data() Adds DivePlotDataModel row upper-boundary check (isValid method already checks for negative values). Signed-off-by: Boris Barbulovski Signed-off-by: Dirk Hohndel --- qt-ui/profile/diveplotdatamodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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()]; -- cgit v1.2.3-70-g09d2