Skip to content

Commit

Permalink
Fix the move-to-level max level value accepted by the command handler (
Browse files Browse the repository at this point in the history
…#18969)

* Limit move to level commands to a level value of 254, else error out the command

* Change error to INVALID_COMMAND
  • Loading branch information
jmartinez-silabs authored May 31, 2022
1 parent 6ef806b commit b78eee1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/app/clusters/level-control/level-control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,11 @@ static EmberAfStatus moveToLevelHandler(EndpointId endpoint, CommandId commandId
return EMBER_ZCL_STATUS_FAILURE;
}

if (level > EMBER_AF_PLUGIN_LEVEL_CONTROL_MAXIMUM_LEVEL)
{
return EMBER_ZCL_STATUS_INVALID_COMMAND;
}

if (!shouldExecuteIfOff(endpoint, commandId, optionMask, optionOverride))
{
return EMBER_ZCL_STATUS_SUCCESS;
Expand Down

0 comments on commit b78eee1

Please sign in to comment.