vim-patch:7.4.789

Problem:    Using freed memory and crash. (Dominique Pellej)
Solution:   Correct use of pointers. (Hirohito Higashi)

9cac424d05
This commit is contained in:
watiko 2015-11-28 01:31:00 +09:00
parent 789041c282
commit 09f6066bb4
2 changed files with 5 additions and 4 deletions

View File

@ -1799,7 +1799,8 @@ do_set (
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,
@ -2384,8 +2385,8 @@ set_string_option (
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();

View File

@ -207,7 +207,7 @@ static int included_patches[] = {
// 792,
791,
// 790,
// 789,
789,
// 788 NA
787,
786,