Skip to content

Commit

Permalink
small robustness improvement
Browse files Browse the repository at this point in the history
avoid that setPaletteColors() overruns buffer limits
  • Loading branch information
softhack007 committed Mar 16, 2023
1 parent 3f4d1a6 commit f633ca3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wled00/json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ void serializePalettes(JsonObject root, AsyncWebServerRequest* request)
if (i < 13) {
break;
}
byte tcp[72];
byte tcp[76] = { 255 }; // WLEDSR bugfix (ensure last entry is always a "stop" marker)
memcpy_P(tcp, (byte*)pgm_read_dword(&(gGradientPalettes[i - 13])), 72);
setPaletteColors(curPalette, tcp);
break;
Expand Down

0 comments on commit f633ca3

Please sign in to comment.