summaryrefslogtreecommitdiff
path: root/src/if_lua.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2015-12-03 17:43:17 +0100
committerBram Moolenaar <Bram@vim.org>2015-12-03 17:43:17 +0100
commitf609dcf8c1094f6fc95f4fc36321a1fb08a7110c (patch)
tree21088be14cf9f39cbfffd204967ca853997fca6d /src/if_lua.c
parentde0ad40cb3c1bc691a754698ed16a5b6cdb4086b (diff)
downloadvim-f609dcf8c1094f6fc95f4fc36321a1fb08a7110c.zip
patch 7.4.954
Problem: When using Lua there may be a crash. (issue #468) Solution: Avoid using an unitialized tv. (Yukihiro Nakadaira)
Diffstat (limited to 'src/if_lua.c')
-rw-r--r--src/if_lua.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/if_lua.c b/src/if_lua.c
index bc2d6c367..e94c96dff 100644
--- a/src/if_lua.c
+++ b/src/if_lua.c
@@ -1561,14 +1561,15 @@ luaV_setref (lua_State *L)
{
tv.v_type = VAR_LIST;
tv.vval.v_list = (list_T *) lua_touserdata(L, 4); /* key */
+ abort = set_ref_in_item(&tv, copyID, NULL, NULL);
}
else if (lua_rawequal(L, -1, 3)) /* dict? */
{
tv.v_type = VAR_DICT;
tv.vval.v_dict = (dict_T *) lua_touserdata(L, 4); /* key */
+ abort = set_ref_in_item(&tv, copyID, NULL, NULL);
}
lua_pop(L, 2); /* metatable and value */
- abort = set_ref_in_item(&tv, copyID, NULL, NULL);
}
lua_pushinteger(L, abort);
return 1;