From 56ad566b27525314d9c3ad8de425f7bd1f402d0f Mon Sep 17 00:00:00 2001 From: Manuel Pietschmann Date: Tue, 6 Aug 2024 18:10:14 +0200 Subject: [PATCH] Fix potential SEGV in Mueller effects (#7873) The index in `RStateEffectValues` wasn't protected. --- de_web_plugin.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/de_web_plugin.cpp b/de_web_plugin.cpp index 88f2f858f1..e858f787d3 100644 --- a/de_web_plugin.cpp +++ b/de_web_plugin.cpp @@ -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