From 63c766a752bd8a55c3a2520e5f5fa9bbe7721719 Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Thu, 14 Dec 2023 15:58:45 +0100 Subject: [PATCH] oappend robustness improvement obuf is reset to nullptr in some cases --- wled00/util.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wled00/util.cpp b/wled00/util.cpp index 2f2f575402..71f5560787 100644 --- a/wled00/util.cpp +++ b/wled00/util.cpp @@ -157,7 +157,7 @@ bool oappendi(int i) bool oappend(const char* txt) { uint16_t len = strlen(txt); - if (olen + len >= SETTINGS_STACK_BUF_SIZE) { + if ((obuf == nullptr) || (olen + len >= SETTINGS_STACK_BUF_SIZE)) { // sanity checks #ifdef WLED_DEBUG DEBUG_PRINT(F("oappend() buffer overflow. Cannot append ")); DEBUG_PRINT(len); DEBUG_PRINT(F(" bytes \t\""));