Skip to content
Permalink
Browse files

Fix secure io.lines

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 3af5eef96463510a27cf06b9c3ecc9f1d04cdac6
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/script/cpp_api/s_security.cpp
@@ -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 comments on commit 3af5eef

Please sign in to comment.
You can’t perform that action at this time.