diff --git a/right/src/config_parser/parse_config.h b/right/src/config_parser/parse_config.h index 2bc44df..1e901c1 100644 --- a/right/src/config_parser/parse_config.h +++ b/right/src/config_parser/parse_config.h @@ -19,6 +19,7 @@ ParserError_InvalidSerializedSwitchKeymapAction, ParserError_InvalidModuleConfigurationCount, ParserError_InvalidKeymapCount, + ParserError_InvalidAbbreviationLen, } parser_error_t; // Functions: diff --git a/right/src/config_parser/parse_keymap.c b/right/src/config_parser/parse_keymap.c index 49da8a5..c2e1ca6 100644 --- a/right/src/config_parser/parse_keymap.c +++ b/right/src/config_parser/parse_keymap.c @@ -205,6 +205,9 @@ parser_error_t ParseKeymap(config_buffer_t *buffer, uint8_t keymapIdx, uint8_t k (void)name; (void)description; + if (!abbreviationLen || abbreviationLen > 3) { + return ParserError_InvalidAbbreviationLen; + } if (layerCount != LAYER_COUNT) { return ParserError_InvalidLayerCount; }