esp-haier icon indicating copy to clipboard operation
esp-haier copied to clipboard

SET_POINT_OFFSET exceeds the size of the control_command array

Open pawelsky opened this issue 3 years ago • 0 comments

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.

pawelsky avatar Dec 16 '21 00:12 pawelsky