From 023ead937fee42adf8d5ac6cff7be143d1dabe21 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Sun, 12 May 2019 01:58:18 +0300 Subject: [PATCH] [Server] Fix stack overflows by preventing infinite growth in Lua stack --- apps/openmw-mp/Script/ScriptFunction.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/openmw-mp/Script/ScriptFunction.cpp b/apps/openmw-mp/Script/ScriptFunction.cpp index b176776f9..9a6d64206 100644 --- a/apps/openmw-mp/Script/ScriptFunction.cpp +++ b/apps/openmw-mp/Script/ScriptFunction.cpp @@ -66,6 +66,8 @@ boost::any ScriptFunction::Call(const vector &args) default: throw runtime_error("Lua call: Unknown return type" + ret_type); } + + lua_settop(fLua.lua, 0); } #endif