Fix settings JS buffer too small (#2323)

This commit is contained in:
Christian Schwinne 2021-11-09 09:56:02 +01:00 committed by GitHub
parent d6ad089c60
commit 5784092c1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 3 deletions

View File

@ -265,7 +265,11 @@
#endif
// string temp buffer (now stored in stack locally)
#define OMAX 2048
#ifdef ESP8266
#define SETTINGS_STACK_BUF_SIZE 2048
#else
#define SETTINGS_STACK_BUF_SIZE 3096
#endif
#ifdef WLED_USE_ETHERNET
#define E131_MAX_UNIVERSE_COUNT 20

View File

@ -42,7 +42,7 @@ bool oappendi(int i)
bool oappend(const char* txt)
{
uint16_t len = strlen(txt);
if (olen + len >= OMAX)
if (olen + len >= SETTINGS_STACK_BUF_SIZE)
return false; // buffer full
strcpy(obuf + olen, txt);
olen += len;

View File

@ -362,9 +362,10 @@ void serveMessage(AsyncWebServerRequest* request, uint16_t code, const String& h
String settingsProcessor(const String& var)
{
if (var == "CSS") {
char buf[2048];
char buf[SETTINGS_STACK_BUF_SIZE];
buf[0] = 0;
getSettingsJS(optionType, buf);
//Serial.println(uxTaskGetStackHighWaterMark(NULL));
return String(buf);
}