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 -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/20221007150038.EDC391C0592%40moolenaar.net.