]> granicus.if.org Git - vim/commitdiff
patch 7.4.789 v7.4.789
authorBram Moolenaar <Bram@vim.org>
Sun, 19 Jul 2015 12:42:23 +0000 (14:42 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 19 Jul 2015 12:42:23 +0000 (14:42 +0200)
Problem:    Using freed memory and crash. (Dominique Pellej)
Solution:   Correct use of pointers. (Hirohito Higashi)

src/option.c
src/version.c

index 35cfd2b006ec07eb7ad6cf267cb118b15e8d5c59..a356f961355800ed636c979fea5c53bc380c1a9d 100644 (file)
@@ -4943,7 +4943,8 @@ do_set(arg, opt_flags)
 
                            sprintf((char *)buf_type, "%s",
                                (opt_flags & OPT_LOCAL) ? "local" : "global");
-                           set_vim_var_string(VV_OPTION_NEW, newval, -1);
+                           set_vim_var_string(VV_OPTION_NEW,
+                                                       *(char_u **)varp, -1);
                            set_vim_var_string(VV_OPTION_OLD, saved_origval, -1);
                            set_vim_var_string(VV_OPTION_TYPE, buf_type, -1);
                            apply_autocmds(EVENT_OPTIONSET,
@@ -5738,8 +5739,8 @@ set_string_option(opt_idx, value, opt_flags)
            char_u buf_type[7];
            sprintf((char *)buf_type, "%s",
                (opt_flags & OPT_LOCAL) ? "local" : "global");
-           set_vim_var_string(VV_OPTION_NEW, s, -1);
-           set_vim_var_string(VV_OPTION_OLD, oldval, -1);
+           set_vim_var_string(VV_OPTION_NEW, *varp, -1);
+           set_vim_var_string(VV_OPTION_OLD, saved_oldval, -1);
            set_vim_var_string(VV_OPTION_TYPE, buf_type, -1);
            apply_autocmds(EVENT_OPTIONSET, (char_u *)options[opt_idx].fullname, NULL, FALSE, NULL);
            reset_v_option_vars();
index aa7b0337eae04b96588e6093d15133159a4c046b..d2c8bc54bf612a89291ebe2c082bcaa958bcd624 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    789,
 /**/
     788,
 /**/