Skip to content
Snippets Groups Projects
Commit 3af5eef9 authored by ShadowNinja's avatar ShadowNinja
Browse files

Fix secure io.lines

It used to drop all of the return values from the
insecure version of the function.
parent 9e10f9f4
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment