Browse Source

Merge pull request #2843 from rgetz/rgetz-fix-index-used-before-check

wdsp: Prevent potential out-of-bounds array access
chirpmodem-v8.0.0
Edouard Griffiths 4 months ago committed by GitHub
parent
commit
b1e685b71c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      wdsp/emnr.cpp
  2. 2
      wdsp/snba.cpp

2
wdsp/emnr.cpp

@ -233,7 +233,7 @@ void EMNR::NP::interpM ( @@ -233,7 +233,7 @@ void EMNR::NP::interpM (
double xlhigh;
double frac;
while ((x >= xvals[idx]) && (idx < nvals - 1))
while ((idx < nvals - 1) && (x >= xvals[idx]))
idx++;
xllow = log10 (xvals[idx - 1]);

2
wdsp/snba.cpp

@ -620,7 +620,7 @@ int SNBA::scanFrame( @@ -620,7 +620,7 @@ int SNBA::scanFrame(
if (nimp > 0)
{
while (merit[i] == merit[0] && i < nimp)
while (i < nimp && merit[i] == merit[0])
i++;
}

Loading…
Cancel
Save