| To: vim_dev@googlegroups.com |
| Subject: Patch 7.4.660 |
| 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.4.660 |
| Problem: Using freed memory when g:colors_name is changed in the colors |
| script. (oni-link) |
| Solution: Make a copy of the variable value. |
| Files: src/syntax.c |
| |
| |
| |
| |
| |
| *** 6988,6995 **** |
| * and 'background' or 't_Co' is changed. |
| */ |
| p = get_var_value((char_u *)"g:colors_name"); |
| ! if (p != NULL && load_colors(p) == OK) |
| ! return; |
| #endif |
| |
| /* |
| --- 6988,7009 ---- |
| * and 'background' or 't_Co' is changed. |
| */ |
| p = get_var_value((char_u *)"g:colors_name"); |
| ! if (p != NULL) |
| ! { |
| ! /* The value of g:colors_name could be freed when sourcing the script, |
| ! * making "p" invalid, so copy it. */ |
| ! char_u *copy_p = vim_strsave(p); |
| ! int r; |
| ! |
| ! if (copy_p != NULL) |
| ! { |
| ! r = load_colors(copy_p); |
| ! vim_free(copy_p); |
| ! if (r == OK) |
| ! return; |
| ! } |
| ! } |
| ! |
| #endif |
| |
| /* |
| |
| |
| |
| *** 743,744 **** |
| --- 743,746 ---- |
| { /* Add new patch number below this line */ |
| + /**/ |
| + 660, |
| /**/ |
| |
| -- |
| This is the polymorph virus! Follow these instructions carefully: |
| 1. Send this message to everybody you know. |
| 2. Format your harddisk. |
| Thank you for your cooperation in spreading the most powerful virus ever! |
| |
| /// 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 /// |