Fixed a potential null pointer dereference and a case of undefined behaviour

This commit is contained in:
Alex Szpakowski
2014-04-11 03:48:12 -03:00
parent b98e6add18
commit f05551a01f
3 changed files with 5 additions and 2 deletions
+1 -1
View File
@@ -538,7 +538,7 @@ int luax_insist(lua_State *L, int idx, const char *k)
{
// Convert to absolute index if necessary.
if (idx < 0 && idx > LUA_REGISTRYINDEX)
idx = lua_gettop(L) + ++idx;
idx += lua_gettop(L) + 1;
lua_getfield(L, idx, k);