AP_NavEKF3: readRngBcnData avoids array overflow from beacon count
This commit is contained in:
parent
660579f2f4
commit
46a7e96c48
@ -827,7 +827,7 @@ void NavEKF3_core::readRngBcnData()
|
||||
}
|
||||
|
||||
// get the number of beacons in use
|
||||
N_beacons = beacon->count();
|
||||
N_beacons = MIN(beacon->count(), ARRAY_SIZE(lastTimeRngBcn_ms));
|
||||
|
||||
// search through all the beacons for new data and if we find it stop searching and push the data into the observation buffer
|
||||
bool newDataPushed = false;
|
||||
|
Loading…
Reference in New Issue
Block a user