1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-19 14:25:11 +03:00

Out of bounds protection for telemetryItems[] array access and some code refactoring for telemetry value precision

This commit is contained in:
Damjan Adamic 2015-10-18 11:46:25 +02:00
parent 4ef9913f76
commit 082ba0893d
8 changed files with 49 additions and 28 deletions

View file

@ -367,8 +367,10 @@ void evalFunctions()
}
#if defined(CPUARM)
if (CFN_PARAM(cfn)>=FUNC_RESET_PARAM_FIRST_TELEM) {
TelemetryItem * telemetryItem = & telemetryItems[CFN_PARAM(cfn)-FUNC_RESET_PARAM_FIRST_TELEM];
telemetryItem->clear();
uint8_t item = CFN_PARAM(cfn)-FUNC_RESET_PARAM_FIRST_TELEM;
if (item < MAX_SENSORS) {
telemetryItems[item].clear();
}
}
#endif
break;