From d6ec20c5412d4120cd93fc5cbf9768478d4bf45b Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sun, 27 Oct 2019 07:03:50 -0400 Subject: Cleanup: avoid out of bounds access This one is a bit complicated as it depends on a specific flow, but it seems like setup_cvs_parms might indeed write NULL to the element at index 49 of parm. I'm not 100% sure that the sequence of events required for this can happen, but adding one more pointer to the array seems like cheap insurance. Found by Coverity. Fixes CID 350120 Signed-off-by: Dirk Hohndel --- desktop-widgets/divelogimportdialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'desktop-widgets/divelogimportdialog.cpp') diff --git a/desktop-widgets/divelogimportdialog.cpp b/desktop-widgets/divelogimportdialog.cpp index 96058283c..0f08b1ec5 100644 --- a/desktop-widgets/divelogimportdialog.cpp +++ b/desktop-widgets/divelogimportdialog.cpp @@ -916,7 +916,7 @@ void DiveLogImportDialog::on_buttonBox_accepted() QPair pair = poseidonFileNames(fileNames[i]); parse_txt_file(qPrintable(pair.second), qPrintable(pair.first), &table, &trips, &sites); } else { - char *params[49]; + char *params[50]; int pnr = 0; QRegExp apdRe("^.*[/\\][0-9a-zA-Z]*_([0-9]{6})_([0-9]{6})\\.apd"); -- cgit v1.2.3-70-g09d2