esp-haier
esp-haier copied to clipboard
SET_POINT_OFFSET exceeds the size of the control_command array
Following warning can be observed when compiling the HaierFlexisPlus.h
file:
src/HaierFlexisPlus.h: In member function 'virtual void Haier::control(const esphome::climate::ClimateCall&)': src/HaierFlexisPlus.h:693:36: warning: array subscript is above array bounds [-Warray-bounds] control_command[SET_POINT_OFFSET] = (uint16) temp - 16;
control_command
array size is 25 bytes, while the SET_POINT_OFFSET
is 35 - this will cause random memory overwrites.