mirror of
https://github.com/esphome/esphome.git
synced 2024-11-23 15:38:11 +01:00
Fix ESP32 RCSwitch Dump Stack Smash Protection (#636)
Fixes https://github.com/esphome/issues/issues/366
This commit is contained in:
parent
80b48f01fb
commit
88c129e705
1 changed files with 1 additions and 1 deletions
|
@ -232,7 +232,7 @@ bool RCSwitchDumper::dump(RemoteReceiveData src) {
|
||||||
uint8_t out_nbits;
|
uint8_t out_nbits;
|
||||||
RCSwitchBase *protocol = &rc_switch_protocols[i];
|
RCSwitchBase *protocol = &rc_switch_protocols[i];
|
||||||
if (protocol->decode(src, &out_data, &out_nbits) && out_nbits >= 3) {
|
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++)
|
for (uint8_t j = 0; j < out_nbits; j++)
|
||||||
buffer[j] = (out_data & (1 << (out_nbits - j - 1))) ? '1' : '0';
|
buffer[j] = (out_data & (1 << (out_nbits - j - 1))) ? '1' : '0';
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue