HTTP power meter: prevent out-of-bound array access
This commit is contained in:
parent
e92701ccdf
commit
247cfe712e
@ -16,6 +16,8 @@ void HttpPowerMeterClass::init()
|
||||
|
||||
float HttpPowerMeterClass::getPower(int8_t phase)
|
||||
{
|
||||
if (phase < 1 || phase > POWERMETER_MAX_PHASES) { return 0.0; }
|
||||
|
||||
return power[phase - 1];
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user