From d74f41d6801928a123f70f7e8455b31171d9e263 Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Mon, 27 Mar 2023 13:19:35 +0200 Subject: [PATCH] oappendi: fix stack corruption due to large numbers (ESP32 only) --- wled00/util.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wled00/util.cpp b/wled00/util.cpp index 66930316..5b93780d 100644 --- a/wled00/util.cpp +++ b/wled00/util.cpp @@ -139,8 +139,8 @@ void sappends(char stype, const char* key, char* val) bool oappendi(int i) { - char s[11]; - sprintf(s, "%d", i); + char s[16]; // WLEDMM max 32bit integer needs 11 chars (sign + 10) not 10 + snprintf(s, 15, "%d", i); // WLEDMM return oappend(s); }