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);