fix(color): string passed to the Lua 'set' function of textEdit control may not be terminated (#6334)

This commit is contained in:
philmoz
2025-06-01 11:37:26 +10:00
committed by GitHub
parent c1887d77e0
commit 6a426ef324
+2 -1
View File
@@ -1911,7 +1911,8 @@ void LvglWidgetTextEdit::build(lua_State *L)
int t = lua_gettop(L);
PROTECT_LUA()
{
if (!pcallFuncWithString(L, setFunction, 0, value)) {
std::string s(value, maxLen); // Ensure string is terminated
if (!pcallFuncWithString(L, setFunction, 0, s.c_str())) {
lvglManager->luaShowError();
}
}