mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-27 09:40:59 -06:00
avoid derefing out-of-bounds if there are no alqs
This commit is contained in:
parent
cecedc1042
commit
ba96a94277
@ -863,7 +863,7 @@ void WellState::communicateGroupRates(const Comm& comm)
|
||||
data[pos++] = 0;
|
||||
}
|
||||
}
|
||||
if (!data.empty()) {
|
||||
if (!data.empty() && pos != sz) {
|
||||
pos += this->alq_state.pack_data(&data[pos]);
|
||||
}
|
||||
assert(pos == sz);
|
||||
@ -879,7 +879,7 @@ void WellState::communicateGroupRates(const Comm& comm)
|
||||
for (auto& value : rates)
|
||||
value = data[pos++];
|
||||
}
|
||||
if (!data.empty()) {
|
||||
if (!data.empty() && pos != sz) {
|
||||
pos += this->alq_state.unpack_data(&data[pos]);
|
||||
}
|
||||
assert(pos == sz);
|
||||
|
Loading…
Reference in New Issue
Block a user