fix(color): string passed to the Lua 'set' function of textEdit control may not be terminated (#6334)
This commit is contained in:
@@ -1911,7 +1911,8 @@ void LvglWidgetTextEdit::build(lua_State *L)
|
|||||||
int t = lua_gettop(L);
|
int t = lua_gettop(L);
|
||||||
PROTECT_LUA()
|
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();
|
lvglManager->luaShowError();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user