mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 07:03:55 +00:00 
			
		
		
		
	Fix ESP32 RCSwitch Dump Stack Smash Protection (#636)
Fixes https://github.com/esphome/issues/issues/366
This commit is contained in:
		| @@ -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'; | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user