From daf8aeeadc47f4fb339e83123118d93347284c86 Mon Sep 17 00:00:00 2001 From: Iampete1 Date: Wed, 22 Nov 2023 19:51:22 +0000 Subject: [PATCH] AP_Param: check dynamic param tables are avalable before adding a param --- libraries/AP_Param/AP_Param.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libraries/AP_Param/AP_Param.cpp b/libraries/AP_Param/AP_Param.cpp index 9e0ad48b85..56d9cbf8ec 100644 --- a/libraries/AP_Param/AP_Param.cpp +++ b/libraries/AP_Param/AP_Param.cpp @@ -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;