What is a Conditionally Uninitialized Variable? The return value of a function that is potentially used to initialize a local variable is not checked. Therefore, reading the local variable may result in undefined behavior.
4 instances of this defect were found in the following locations:
level = last - LEVELS2 + 1; /* and skip to last ones */
}
else {
lua_getinfo(L1, "Slnt", &ar); <------ HERE
lua_pushfstring(L, "\n\t%s:", ar.short_src);
if (ar.currentline > 0)
LUALIB_API void luaL_where (lua_State *L, int level) {
lua_Debug ar;
if (lua_getstack(L, level, &ar)) { /* check function at level */
lua_getinfo(L, "Sl", &ar); /* get info about it */ <------ HERE
if (ar.currentline > 0) { /* is there info? */
lua_pushfstring(L, "%s:%d: ", ar.short_src, ar.currentline);
What is a Conditionally Uninitialized Variable? The return value of a function that is potentially used to initialize a local variable is not checked. Therefore, reading the local variable may result in undefined behavior.
4 instances of this defect were found in the following locations:
Instance 1 File :
src/libs/lua/lauxlib.c
Function:lua_getinfo
https://github.com/sagpant/simpleai/blob/db3acd891f46f67ae70c271bf88a46e6e6b28b0f/src/libs/lua/lauxlib.c#L142 Issue in: arCode extract:
How can I fix it? Correct reference usage found in
src/libs/lua/ldblib.c
at line162
. https://github.com/sagpant/simpleai/blob/db3acd891f46f67ae70c271bf88a46e6e6b28b0f/src/libs/lua/ldblib.c#L162 Code extract:Instance 2 File :
src/libs/lua/lauxlib.c
Function:lua_getinfo
https://github.com/sagpant/simpleai/blob/db3acd891f46f67ae70c271bf88a46e6e6b28b0f/src/libs/lua/lauxlib.c#L169 Issue in: arCode extract:
How can I fix it? Correct reference usage found in
src/libs/lua/ldblib.c
at line162
. https://github.com/sagpant/simpleai/blob/db3acd891f46f67ae70c271bf88a46e6e6b28b0f/src/libs/lua/ldblib.c#L162 Code extract:Instance 3 File :
src/libs/lua/lauxlib.c
Function:lua_getinfo
https://github.com/sagpant/simpleai/blob/db3acd891f46f67ae70c271bf88a46e6e6b28b0f/src/libs/lua/lauxlib.c#L209 Issue in: arCode extract:
How can I fix it? Correct reference usage found in
src/libs/lua/ldblib.c
at line162
. https://github.com/sagpant/simpleai/blob/db3acd891f46f67ae70c271bf88a46e6e6b28b0f/src/libs/lua/ldblib.c#L162 Code extract:Instance 4 File :
src/libs/lua/lauxlib.c
Function:skipcomment
https://github.com/sagpant/simpleai/blob/db3acd891f46f67ae70c271bf88a46e6e6b28b0f/src/libs/lua/lauxlib.c#L724 Issue in: cCode extract:
How can I fix it? Correct reference usage found in
src/libs/lua/lauxlib.c
at line719
. https://github.com/sagpant/simpleai/blob/db3acd891f46f67ae70c271bf88a46e6e6b28b0f/src/libs/lua/lauxlib.c#L719 Code extract: