Fix settings JS buffer too small (#2323)
This commit is contained in:
parent
d6ad089c60
commit
5784092c1b
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user