Skip to content

Commit

Permalink
AP_Param: check dynamic param tables are avalable before adding a param
Browse files Browse the repository at this point in the history
  • Loading branch information
IamPete1 authored and tridge committed Nov 28, 2023
1 parent 772dbfb commit daf8aee
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libraries/AP_Param/AP_Param.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2999,6 +2999,11 @@ bool AP_Param::load_int32(uint16_t key, uint32_t group_element, int32_t &value)
*/
bool AP_Param::add_param(uint8_t _key, uint8_t param_num, const char *pname, float default_value)
{
if (_var_info_dynamic == nullptr) {
// No dynamic tables available
return false;
}

// check for valid values
if (param_num == 0 || param_num > 63 || strlen(pname) > 16) {
return false;
Expand Down

0 comments on commit daf8aee

Please sign in to comment.