From f5764337cb4b7a4668bae85ab6ed9758a98206fe Mon Sep 17 00:00:00 2001 From: ThePhD Date: Sat, 20 Jan 2018 14:31:49 -0500 Subject: [PATCH] purge past-the-stack access in protected function result --- single/sol/sol.hpp | 7 +++++-- single/sol/sol_forward.hpp | 4 ++-- sol/reference.hpp | 3 +++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/single/sol/sol.hpp b/single/sol/sol.hpp index 2050dff2..bf28d4af 100644 --- a/single/sol/sol.hpp +++ b/single/sol/sol.hpp @@ -20,8 +20,8 @@ // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // This file was generated with a script. -// Generated 2018-01-20 18:42:23.650677 UTC -// This header was generated with sol v2.19.0 (revision 0afd822) +// Generated 2018-01-20 19:31:24.245892 UTC +// This header was generated with sol v2.19.0 (revision cbd7923) // https://github.com/ThePhD/sol2 #ifndef SOL_SINGLE_INCLUDE_HPP @@ -6072,6 +6072,9 @@ namespace sol { if (count < 1) return; int top = lua_gettop(L); + if (top < 1) { + return; + } if (rawindex == -count || top == rawindex) { // Slice them right off the top lua_pop(L, static_cast(count)); diff --git a/single/sol/sol_forward.hpp b/single/sol/sol_forward.hpp index 8a7d215e..92f1971c 100644 --- a/single/sol/sol_forward.hpp +++ b/single/sol/sol_forward.hpp @@ -20,8 +20,8 @@ // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // This file was generated with a script. -// Generated 2018-01-20 18:42:23.882794 UTC -// This header was generated with sol v2.19.0 (revision 0afd822) +// Generated 2018-01-20 19:31:24.431906 UTC +// This header was generated with sol v2.19.0 (revision cbd7923) // https://github.com/ThePhD/sol2 #ifndef SOL_SINGLE_INCLUDE_FORWARD_HPP diff --git a/sol/reference.hpp b/sol/reference.hpp index 40fe98cc..e87e4e63 100644 --- a/sol/reference.hpp +++ b/sol/reference.hpp @@ -40,6 +40,9 @@ namespace sol { if (count < 1) return; int top = lua_gettop(L); + if (top < 1) { + return; + } if (rawindex == -count || top == rawindex) { // Slice them right off the top lua_pop(L, static_cast(count));