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 <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2019-10-27 07:03:50 -04:00
parent ee6b89268e
commit d6ec20c541

View file

@ -916,7 +916,7 @@ void DiveLogImportDialog::on_buttonBox_accepted()
QPair<QString, QString> 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");