diff options
author | Bram Moolenaar <Bram@vim.org> | 2012-12-12 16:11:36 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2012-12-12 16:11:36 +0100 |
commit | 27356ad4f47eb87eb9889d4bd06eaecc7944763f (patch) | |
tree | f220f6cf7998a702bc0b096b1dbc728eab20c86b | |
parent | 321a9ec68041c75169002e54c1994a7d3933abbd (diff) | |
download | vim-git-27356ad4f47eb87eb9889d4bd06eaecc7944763f.tar.gz |
updated for version 7.3.757v7.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.
-rw-r--r-- | src/ops.c | 6 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 8 insertions, 0 deletions
@@ -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 index aec15bdd0..562bb043f 100644 --- 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, |