| To: vim_dev@googlegroups.com |
| Subject: Patch 7.3.757 |
| Fcc: outbox |
| From: Bram Moolenaar <Bram@moolenaar.net> |
| Mime-Version: 1.0 |
| Content-Type: text/plain; charset=UTF-8 |
| Content-Transfer-Encoding: 8bit |
| |
| |
| Patch 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. |
| Files: src/ops.c |
| |
| |
| |
| |
| |
| *** 3351,3356 **** |
| --- 3351,3362 ---- |
| 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; |
| |
| |
| |
| *** 727,728 **** |
| --- 727,730 ---- |
| { /* Add new patch number below this line */ |
| + /**/ |
| + 757, |
| /**/ |
| |
| -- |
| We are the Borg of GNU GPL. We will assimilate your source code. |
| Resistance is futile. |
| |
| /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ |
| /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ |
| \\\ an exciting new programming language -- http://www.Zimbu.org /// |
| \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |