From 8345f3f87297f4fe3c5e78e53c854ac9377e824b Mon Sep 17 00:00:00 2001 From: andrethomas Date: Mon, 15 Oct 2018 22:30:26 +0200 Subject: [PATCH] Fix SerialSendRaw() to adjust for whitespace Fix SerialSendRaw() to adjust for whitespace removal --- sonoff/support.ino | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sonoff/support.ino b/sonoff/support.ino index a81699a8c..6dd6776f0 100644 --- a/sonoff/support.ino +++ b/sonoff/support.ino @@ -755,6 +755,8 @@ void SerialSendRaw(char *codes, int size) char *p; char stemp[3]; uint8_t code; + + size = strlen(codes); // Force size to be strlen of codes, if whitespace was removed it will overrun into unwanted buffer space while (size > 0) { snprintf(stemp, sizeof(stemp), codes);