Skip to content

Commit

Permalink
Fix secure io.lines
Browse files Browse the repository at this point in the history
It used to drop all of the return values from the
insecure version of the function.
  • Loading branch information
ShadowNinja committed Nov 24, 2016
1 parent 9e10f9f commit 3af5eef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/script/cpp_api/s_security.cpp
Expand Up @@ -577,13 +577,13 @@ int ScriptApiSecurity::sl_io_lines(lua_State *L)
CHECK_SECURE_PATH(L, path);
}

int top_precall = lua_gettop(L);
push_original(L, "io", "lines");
lua_pushvalue(L, 1);
int top_precall = lua_gettop(L);
lua_call(L, 1, LUA_MULTRET);
// Return number of arguments returned by the function,
// adjusting for the function being poped.
return lua_gettop(L) - (top_precall - 1);
return lua_gettop(L) - top_precall;
}


Expand Down

0 comments on commit 3af5eef

Please sign in to comment.