mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-14 11:59:58 +03:00
rc-modes bugfix - prevent buffer overflow when serializing box names (#13880)
This commit is contained in:
parent
1382c30601
commit
aa92203215
5 changed files with 40 additions and 35 deletions
|
@ -124,12 +124,10 @@ PG_DECLARE_ARRAY(modeActivationCondition_t, MAX_MODE_ACTIVATION_CONDITION_COUNT,
|
|||
#if defined(USE_CUSTOM_BOX_NAMES)
|
||||
|
||||
#define MAX_BOX_USER_NAME_LENGTH 16
|
||||
|
||||
#define BOX_USER_NAME_COUNT 4
|
||||
STATIC_ASSERT(BOXUSER4 + 1 - BOXUSER1 == BOX_USER_NAME_COUNT, "Invalid BOX_USER_NAME_COUNT");
|
||||
typedef struct modeActivationConfig_s {
|
||||
char box_user_1_name[MAX_BOX_USER_NAME_LENGTH];
|
||||
char box_user_2_name[MAX_BOX_USER_NAME_LENGTH];
|
||||
char box_user_3_name[MAX_BOX_USER_NAME_LENGTH];
|
||||
char box_user_4_name[MAX_BOX_USER_NAME_LENGTH];
|
||||
char box_user_names[BOX_USER_NAME_COUNT][MAX_BOX_USER_NAME_LENGTH];
|
||||
} modeActivationConfig_t;
|
||||
|
||||
PG_DECLARE(modeActivationConfig_t, modeActivationConfig);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue