summaryrefslogtreecommitdiff
path: root/src/tsg_lua_func.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tsg_lua_func.cpp')
-rw-r--r--src/tsg_lua_func.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/tsg_lua_func.cpp b/src/tsg_lua_func.cpp
index f59fbbc..feecae6 100644
--- a/src/tsg_lua_func.cpp
+++ b/src/tsg_lua_func.cpp
@@ -184,6 +184,9 @@ static int tsg_lua_clfactory_bytecode_buffer_prepare(tsg_lua_clfactory_buffer_t
{
int little_endian, version, stripped;
+ if (ls == NULL)
+ return -1;
+
if (ls->file_type == TSG_LUA_BC_LJ)
{
/* get bytecode header */
@@ -725,6 +728,8 @@ int tsg_lua_exec(tsg_lua_handle lua, const char *script, size_t script_len, cons
tsg_lua_clfactory_buffer_t ls;
jmp_buf *lua_exception;
+ memset(&ls, 0, sizeof(tsg_lua_clfactory_buffer_t));
+
if (L == NULL)
{
debuginfo("lua VM is null.", __FILE__, __LINE__);