AP_NavEKF3: readRngBcnData avoids array overflow from beacon count

This commit is contained in:
Randy Mackay 2020-08-21 12:59:15 +09:00
parent 660579f2f4
commit 46a7e96c48
1 changed files with 1 additions and 1 deletions

View File

@ -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;