Merge pull request #3776 from akva2/esmry_fix_oob

ESmry: fix out-of-bounds vector access
This commit is contained in:
Bård Skaflestad
2023-11-17 13:33:38 +01:00
committed by GitHub

View File

@@ -1084,6 +1084,9 @@ bool ESmry::make_esmry_file()
{
std::vector<int> start_date_vect = start_vect;
if (start_date_vect.size() < 6) {
start_date_vect.resize(6);
}
int sec = start_date_vect[5] / 1000000;
int millisec = (start_date_vect[5] % 1000000) / 1000;
@@ -1094,7 +1097,7 @@ bool ESmry::make_esmry_file()
std::vector<std::string> units;
units.reserve(keyword.size());
for (auto key : keyword)
for (const auto& key : keyword)
units.push_back(kwunits.at(key));