projects
/
oweals
/
minetest.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9e10f9f
)
Fix secure io.lines
author
ShadowNinja
<shadowninja@minetest.net>
Thu, 24 Nov 2016 15:10:20 +0000
(10:10 -0500)
committer
ShadowNinja
<shadowninja@minetest.net>
Thu, 24 Nov 2016 15:10:20 +0000
(10:10 -0500)
It used to drop all of the return values from the
insecure version of the function.
src/script/cpp_api/s_security.cpp
patch
|
blob
|
history
diff --git
a/src/script/cpp_api/s_security.cpp
b/src/script/cpp_api/s_security.cpp
index 5a64c249c977fce52b8055cfc9b05860906bda8e..c9816f89bd512fafbf105476577b61901d8c6f1e 100644
(file)
--- a/
src/script/cpp_api/s_security.cpp
+++ b/
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
;
}