]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
updated for version 7.3.757 v7.3.757
authorBram Moolenaar <Bram@vim.org>
Wed, 12 Dec 2012 15:11:36 +0000 (16:11 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 12 Dec 2012 15:11:36 +0000 (16:11 +0100)
Problem:    Issue 96: May access freed memory when a put command triggers
            autocommands. (Dominique Pelle)
Solution:   Call u_save() before getting y_array.

src/ops.c
src/version.c

index f08e576cfead740d7dfe350475b8f35275335a7b..9b669b3317216b26f206f3aa427ebc4d47b81e56 100644 (file)
--- 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;
index aec15bdd0253d27ad5cf71a609ea4cb8c886f2bf..562bb043f5ec40d0277a46119af489d59cbf4423 100644 (file)
@@ -725,6 +725,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    757,
 /**/
     756,
 /**/