mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-26 04:11:18 +00:00
Merge branch 'fix-cv-call-segfault' into 'master'
Fix possible segfault for cvars registered from lua with flag CV_CALL See merge request KartKrew/Kart-Public!328
This commit is contained in:
commit
8b557c724e
1 changed files with 1 additions and 1 deletions
|
@ -382,7 +382,7 @@ static int lib_cvRegisterVar(lua_State *L)
|
||||||
cvar->PossibleValue = cvpv;
|
cvar->PossibleValue = cvpv;
|
||||||
} else
|
} else
|
||||||
FIELDERROR("PossibleValue", va("%s or CV_PossibleValue_t expected, got %s", lua_typename(L, LUA_TTABLE), luaL_typename(L, -1)))
|
FIELDERROR("PossibleValue", va("%s or CV_PossibleValue_t expected, got %s", lua_typename(L, LUA_TTABLE), luaL_typename(L, -1)))
|
||||||
} else if (cvar->flags & CV_CALL && (i == 5 || (k && fasticmp(k, "func")))) {
|
} else if ((i == 5 || (k && fasticmp(k, "func")))) {
|
||||||
if (!lua_isfunction(L, 4))
|
if (!lua_isfunction(L, 4))
|
||||||
TYPEERROR("func", LUA_TFUNCTION)
|
TYPEERROR("func", LUA_TFUNCTION)
|
||||||
lua_getfield(L, LUA_REGISTRYINDEX, "CV_OnChange");
|
lua_getfield(L, LUA_REGISTRYINDEX, "CV_OnChange");
|
||||||
|
|
Loading…
Reference in a new issue