changeset 7297:67c7a524b84f v7.4.954

commit https://github.com/vim/vim/commit/f609dcf8c1094f6fc95f4fc36321a1fb08a7110c Author: Bram Moolenaar <Bram@vim.org> Date: Thu Dec 3 17:43:17 2015 +0100 patch 7.4.954 Problem: When using Lua there may be a crash. (issue https://github.com/vim/vim/issues/468) Solution: Avoid using an unitialized tv. (Yukihiro Nakadaira)
author Christian Brabandt <cb@256bit.org>
date Thu, 03 Dec 2015 17:45:04 +0100
parents e6bcb444a970
children 472706259af6
files src/if_lua.c src/version.c
diffstat 2 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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;
--- a/src/version.c
+++ b/src/version.c
@@ -742,6 +742,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    954,
+/**/
     953,
 /**/
     952,