From af4dd080c5aa20d5f8b285f13d47be3f9b4c3040 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Tue, 23 Jul 2019 10:22:14 +0200 Subject: [PATCH] Fix possible IRSend input corruption Fix possible IRSend input corruption --- sonoff/_changelog.ino | 9 +++++---- sonoff/my_user_config.h | 2 +- sonoff/xdrv_05_irremote.ino | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/sonoff/_changelog.ino b/sonoff/_changelog.ino index 052cedd7a..5564bbefa 100644 --- a/sonoff/_changelog.ino +++ b/sonoff/_changelog.ino @@ -3,9 +3,10 @@ * Add support for Sonoff iFan03 as module 71 (#5988) * Add support for a buzzer * Add command SetOption67 0/1 to disable or enable a buzzer as used in iFan03 - * Add support IRSend long press ('repeat' feature from IRRemoteESP8266) (#6074) - * Add support for optional IRHVAC Midea/Komeco protocol (#3227) - * Fix IRSend for Pioneer devices (#6100) + * Add support for IRSend long press ('repeat' feature from IRRemoteESP8266) (#6074) + * Add support for IRHVAC Midea/Komeco protocol (#3227) + * Add support for more IRSend protocols enabled in my_user_config.h + * Add support for IRSend Pioneer protocol (#6100) * * 6.6.0.1 20190708 * Fix Domoticz battery level set to 100 if define USE_ADC_VCC is not used (#6033) @@ -31,7 +32,7 @@ * Refactor TLS based on BearSSL, warning breaking change for fingerprints validation * Refactor management of lights, using classes and integers instead of floats * Refactor UDP initial message handling from string to char using static memory and add debug info (#5505) - * Refactor IRsend and receive for 64-bit support (#5523) + * Refactor IRSend and receive for 64-bit support (#5523) * Refactor MQTT which might solve issue (#5755) * Refactor IRSend by using heap when more than 199 values need to be send. May need increase of define MQTT_MAX_PACKET_SIZE too (#5950) * Refactor double to float in rules, and replaced trigonometric functions from stdlib with smaller versions (#6005) diff --git a/sonoff/my_user_config.h b/sonoff/my_user_config.h index a4b9416ca..b4d5d1716 100644 --- a/sonoff/my_user_config.h +++ b/sonoff/my_user_config.h @@ -436,6 +436,7 @@ // #define USE_IR_SEND_MITSUBISHI // Support IRsend Mitsubishi protocol #define USE_IR_SEND_NEC // Support IRsend NEC protocol #define USE_IR_SEND_PANASONIC // Support IRsend Panasonic protocol + #define USE_IR_SEND_PIONEER // Support IRsend Pioneer protocol #define USE_IR_SEND_RC5 // Support IRsend Philips RC5 protocol #define USE_IR_SEND_RC6 // Support IRsend Philips RC6 protocol #define USE_IR_SEND_SAMSUNG // Support IRsend Samsung protocol @@ -443,7 +444,6 @@ // #define USE_IR_SEND_SHARP // Support IRsend Sharp protocol #define USE_IR_SEND_SONY // Support IRsend Sony protocol // #define USE_IR_SEND_WHYNTER // Support IRsend Whynter protocol - #define USE_IR_SEND_PIONEER // Support IRsend Pioneer protocol // #define USE_IR_HVAC // Support for HVAC systems using IR (+3k5 code) #define USE_IR_HVAC_TOSHIBA // Support IRhvac Toshiba protocol diff --git a/sonoff/xdrv_05_irremote.ino b/sonoff/xdrv_05_irremote.ino index 05e6d6a8f..8de03e9ec 100644 --- a/sonoff/xdrv_05_irremote.ino +++ b/sonoff/xdrv_05_irremote.ino @@ -822,7 +822,7 @@ bool IrSendCommand(void) if (strlen(dataBufUc) < 8) { error = IE_INVALID_JSON; } else { - StaticJsonBuffer<128> jsonBuf; + StaticJsonBuffer<140> jsonBuf; JsonObject &root = jsonBuf.parseObject(dataBufUc); if (!root.success()) { error = IE_INVALID_JSON;