# HG changeset patch # User Bram Moolenaar # Date 1355325096 -3600 # Node ID 65ef7c96d65fb2fbf660797608809f0ac5d0c4b7 # Parent 74a6e96270baae117f426d150eea11ff03408212 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. diff --git a/src/ops.c b/src/ops.c --- a/src/ops.c +++ b/src/ops.c @@ -3351,6 +3351,12 @@ do_put(regname, dir, count, flags) 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) { y_type = MCHAR; diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -726,6 +726,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 757, +/**/ 756, /**/ 755,