mirror of
https://github.com/jankae/LibreVNA.git
synced 2025-12-06 07:12:10 +01:00
fix buffer overflow when combining de-embedding with custom expressions
This commit is contained in:
parent
8a5d56ee39
commit
69bb1e493e
|
|
@ -91,6 +91,14 @@ void Math::Expression::inputSamplesChanged(unsigned int begin, unsigned int end)
|
||||||
}
|
}
|
||||||
dataMutex.lock();
|
dataMutex.lock();
|
||||||
data.resize(in.size());
|
data.resize(in.size());
|
||||||
|
// sanity check input values
|
||||||
|
if(end > 0 && end > in.size()) {
|
||||||
|
end = in.size() - 1;
|
||||||
|
}
|
||||||
|
if(end <= begin) {
|
||||||
|
dataMutex.unlock();
|
||||||
|
return;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
for(unsigned int i=begin;i<end;i++) {
|
for(unsigned int i=begin;i<end;i++) {
|
||||||
t = in[i].x;
|
t = in[i].x;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue