1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

Fix out of bounds vector access

This commit is contained in:
Philipp Jungkamp 2022-06-29 20:24:23 +00:00
parent 3e787eeb85
commit 11b84bc2b9

View file

@ -514,7 +514,7 @@ int SlaveNode::_write(Sample *samples[], unsigned sample_count)
// update last_values
this->output.last_values_mutex.lock();
for (unsigned i = 0; i < sample->length; i++) {
for (unsigned i = 0; i < MIN(sample->length, this->output.last_values.size()); i++) {
this->output.last_values[i] = sample->data[i];
}
this->output.last_values_mutex.unlock();