Skip to content

Commit

Permalink
fix(cpn): Size of the YamlStickConfig struct was set wrong (#2891)
Browse files Browse the repository at this point in the history
The YamlStickConfig definition was defined and sized with CPN_MAX_SWITCHES (32) instead of CPN_MAX_STICKS (4).
When loading radio.yml this would overwrite 112 bytes past the end of the stickName array in the GeneralSettings class.
  • Loading branch information
philmoz authored and pfeerick committed Dec 23, 2022
1 parent fa1844e commit fdcf7cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion companion/src/firmwares/edgetx/yaml_switchconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ struct YamlNameConfig {
}
};

typedef YamlNameConfig<CPN_MAX_SWITCHES, YamlStickLookup> YamlStickConfig;
typedef YamlNameConfig<CPN_MAX_STICKS, YamlStickLookup> YamlStickConfig;

template <unsigned int N, class name_lookup, const YamlLookupTable& cfg_lut>
struct YamlKnobConfig : public YamlNameConfig<N, name_lookup> {
Expand Down

0 comments on commit fdcf7cf

Please sign in to comment.