Skip to content

Commit

Permalink
Fix potential SEGV in Mueller effects (dresden-elektronik#7873)
Browse files Browse the repository at this point in the history
The index in `RStateEffectValues` wasn't protected.
  • Loading branch information
manup authored Aug 6, 2024
1 parent d648c8b commit 56ad566
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion de_web_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3690,7 +3690,10 @@ LightNode *DeRestPluginPrivate::updateLightNode(const deCONZ::NodeEvent &event)
{
if (RStateEffectValuesMueller.indexOf(lightNode->toString(RStateEffect), 0) <= 1)
{
lightNode->setValue(RStateEffect, RStateEffectValues[ia->numericValue().u8]);
if ((int)ia->numericValue().u8 < RStateEffectValues.size())
{
lightNode->setValue(RStateEffect, RStateEffectValues[ia->numericValue().u8]);
}
}
}
else if (ia->id() == 0x4004) // color loop time
Expand Down

0 comments on commit 56ad566

Please sign in to comment.