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


*** ../vim-7.4.659/src/syntax.c 2015-02-03 13:00:34.404529640 +0100
--- src/syntax.c        2015-03-13 12:48:03.203291145 +0100
***************
*** 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
  
      /*
*** ../vim-7.4.659/src/version.c        2015-03-13 11:23:46.446245826 +0100
--- src/version.c       2015-03-13 12:50:42.297597991 +0100
***************
*** 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 -- [email protected] -- 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    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui