From c36e493b47d09895c172d49c5e27bb995dcf0052 Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Fri, 21 Nov 2025 00:16:25 +0100 Subject: [PATCH] Fix strlcpy destination size parameters --- wled00/FX_fcn.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wled00/FX_fcn.cpp b/wled00/FX_fcn.cpp index 341fc52b..d307b5b8 100644 --- a/wled00/FX_fcn.cpp +++ b/wled00/FX_fcn.cpp @@ -1736,14 +1736,14 @@ void WS2812FX::enumerateLedmaps() { (void) cleanUpName(name); len = strlen(name); ledmapNames[i-1] = new(std::nothrow) char[len+1]; // +1 to include terminating \0 - if (ledmapNames[i-1]) strlcpy(ledmapNames[i-1], name, sizeof(name)); + if (ledmapNames[i-1]) strlcpy(ledmapNames[i-1], name, len+1); } if (!ledmapNames[i-1]) { char tmp[33]; snprintf_P(tmp, 32, PSTR("ledmap%d.json"), i); size_t tmplen = strlen(tmp); ledmapNames[i-1] = new(std::nothrow) char[tmplen+1]; - if (ledmapNames[i-1]) strlcpy(ledmapNames[i-1], tmp, tmplen); + if (ledmapNames[i-1]) strlcpy(ledmapNames[i-1], tmp, tmplen+1); } USER_PRINTF("enumerateLedmaps %s \"%s\"", fileName, name);