From 88c129e7051fbe201c97859b03b41ec3165bcafc Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Fri, 14 Jun 2019 12:34:45 +0200 Subject: [PATCH] Fix ESP32 RCSwitch Dump Stack Smash Protection (#636) Fixes https://github.com/esphome/issues/issues/366 --- esphome/components/remote_base/rc_switch_protocol.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/components/remote_base/rc_switch_protocol.cpp b/esphome/components/remote_base/rc_switch_protocol.cpp index d983ffeb23..029f1fccf2 100644 --- a/esphome/components/remote_base/rc_switch_protocol.cpp +++ b/esphome/components/remote_base/rc_switch_protocol.cpp @@ -232,7 +232,7 @@ bool RCSwitchDumper::dump(RemoteReceiveData src) { uint8_t out_nbits; RCSwitchBase *protocol = &rc_switch_protocols[i]; if (protocol->decode(src, &out_data, &out_nbits) && out_nbits >= 3) { - char buffer[32]; + char buffer[33]; for (uint8_t j = 0; j < out_nbits; j++) buffer[j] = (out_data & (1 << (out_nbits - j - 1))) ? '1' : '0';