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:
parent
4ef9913f76
commit
082ba0893d
8 changed files with 49 additions and 28 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue