Patch 9.0.0685

5 views
Skip to first unread message

Bram Moolenaar

unread,
Oct 7, 2022, 11:00:52 AM10/7/22
to vim...@googlegroups.com

Patch 9.0.0685
Problem: FORTIFY_SOURCE causes a crash in Vim9 script.
Solution: Use a pointer to the first char. (Yee Cheng Chin, closes #11302)
Files: src/vim9script.c


*** ../vim-9.0.0684/src/vim9script.c 2022-08-24 16:30:30.690752449 +0100
--- src/vim9script.c 2022-10-07 15:53:19.538696834 +0100
***************
*** 140,146 ****
0L, (char_u *)CPO_VIM, OPT_NO_REDRAW);
}
#else
! // No check for this being the first command, it doesn't matter.
current_sctx.sc_version = SCRIPT_VERSION_VIM9;
#endif
}
--- 140,147 ----
0L, (char_u *)CPO_VIM, OPT_NO_REDRAW);
}
#else
! // No check for this being the first command, the information is not
! // available.
current_sctx.sc_version = SCRIPT_VERSION_VIM9;
#endif
}
***************
*** 969,975 ****
sv->sv_flags |= SVFLAG_ASSIGNED;
newsav->sav_var_vals_idx = si->sn_var_vals.ga_len;
++si->sn_var_vals.ga_len;
! STRCPY(&newsav->sav_key, name);
sv->sv_name = newsav->sav_key;
newsav->sav_di = di;
newsav->sav_block_id = si->sn_current_block_id;
--- 970,977 ----
sv->sv_flags |= SVFLAG_ASSIGNED;
newsav->sav_var_vals_idx = si->sn_var_vals.ga_len;
++si->sn_var_vals.ga_len;
! // a pointer to the first char avoids a FORTIFY_SOURCE problem
! STRCPY(&newsav->sav_key[0], name);
sv->sv_name = newsav->sav_key;
newsav->sav_di = di;
newsav->sav_block_id = si->sn_current_block_id;
*** ../vim-9.0.0684/src/version.c 2022-10-07 15:09:24.608804815 +0100
--- src/version.c 2022-10-07 15:54:46.526325288 +0100
***************
*** 701,702 ****
--- 701,704 ----
{ /* Add new patch number below this line */
+ /**/
+ 685,
/**/

--
Experience is what you get when you don't get what you want.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages