From c87b9645e7a574c0866b5ba2a5b3530e6c5f98c6 Mon Sep 17 00:00:00 2001 From: Miika Turkia Date: Sun, 6 Sep 2015 21:40:13 +0300 Subject: CSV import: validate column count We need at least 23 columns when reading in Subsurface CSV. Signed-off-by: Miika Turkia Signed-off-by: Dirk Hohndel --- qt-ui/divelogimportdialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qt-ui') diff --git a/qt-ui/divelogimportdialog.cpp b/qt-ui/divelogimportdialog.cpp index 49b68174e..c21a6a18e 100644 --- a/qt-ui/divelogimportdialog.cpp +++ b/qt-ui/divelogimportdialog.cpp @@ -583,7 +583,7 @@ void DiveLogImportDialog::loadFileContents(int value, whatChanged triggeredBy) headers.replace(CSVApps[value].setpoint, tr("Sample setpoint")); /* Show the Subsurface CSV column headers */ - if (value == SUBSURFACE) { + if (value == SUBSURFACE && currColumns.count() >= 23) { headers.replace(0, tr("Dive #")); headers.replace(1, tr("Date")); headers.replace(2, tr("Time")); -- cgit v1.2.3-70-g09d2