mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
updated for version 7.3.757
Problem: Issue 96: May access freed memory when a put command triggers autocommands. (Dominique Pelle) Solution: Call u_save() before getting y_array.
This commit is contained in:
@@ -3351,6 +3351,12 @@ do_put(regname, dir, count, flags)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef FEAT_AUTOCMD
|
||||||
|
/* Autocommands may be executed when saving lines for undo, which may make
|
||||||
|
* y_array invalid. Start undo now to avoid that. */
|
||||||
|
u_save(curwin->w_cursor.lnum, curwin->w_cursor.lnum + 1);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (insert_string != NULL)
|
if (insert_string != NULL)
|
||||||
{
|
{
|
||||||
y_type = MCHAR;
|
y_type = MCHAR;
|
||||||
|
@@ -725,6 +725,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
757,
|
||||||
/**/
|
/**/
|
||||||
756,
|
756,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user