Skip to content

Commit 3af5eef

Browse files
committedNov 24, 2016
Fix secure io.lines
It used to drop all of the return values from the insecure version of the function.
1 parent 9e10f9f commit 3af5eef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

Diff for: ‎src/script/cpp_api/s_security.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -577,13 +577,13 @@ int ScriptApiSecurity::sl_io_lines(lua_State *L)
577577
CHECK_SECURE_PATH(L, path);
578578
}
579579

580+
int top_precall = lua_gettop(L);
580581
push_original(L, "io", "lines");
581582
lua_pushvalue(L, 1);
582-
int top_precall = lua_gettop(L);
583583
lua_call(L, 1, LUA_MULTRET);
584584
// Return number of arguments returned by the function,
585585
// adjusting for the function being poped.
586-
return lua_gettop(L) - (top_precall - 1);
586+
return lua_gettop(L) - top_precall;
587587
}
588588

589589

0 commit comments

Comments
 (0)
Please sign in to comment.