Patch 7.3.701
Problem:    MS-Windows: Crash with stack overflow when setting 'encoding'.
Solution:   Handle that loading the iconv library may be called recursively.
            (Jiri Sedlak)
Files:      src/os_win32.c


*** ../vim-7.3.700/src/os_win32.c       2012-08-02 12:31:40.000000000 +0200
--- src/os_win32.c      2012-10-21 02:35:21.000000000 +0200
***************
*** 288,305 ****
  vimLoadLib(char *name)
  {
      HINSTANCE dll = NULL;
!     char old_dir[MAXPATHL];
  
      if (exe_path == NULL)
        get_exe_name();
!     if (exe_path != NULL && mch_dirname(old_dir, MAXPATHL) == OK)
      {
        /* Change directory to where the executable is, both to make sure we
         * find a .dll there and to avoid looking for a .dll in the current
         * directory. */
!       mch_chdir(exe_path);
        dll = LoadLibrary(name);
-       mch_chdir(old_dir);
      }
      return dll;
  }
--- 288,313 ----
  vimLoadLib(char *name)
  {
      HINSTANCE dll = NULL;
!     TCHAR old_dir[MAXPATHL];
  
+     /* NOTE: Do not use mch_dirname() and mch_chdir() here, they may call
+      * vimLoadLib() recursively, which causes a stack overflow. */
      if (exe_path == NULL)
        get_exe_name();
!     if (exe_path != NULL && GetCurrentDirectory(MAXPATHL, old_dir) != 0)
      {
        /* Change directory to where the executable is, both to make sure we
         * find a .dll there and to avoid looking for a .dll in the current
         * directory. */
!       SetCurrentDirectory(exe_path);
!       dll = LoadLibrary(name);
!       SetCurrentDirectory(old_dir);
!     }
!     else
!     {
!       /* We are not able to change directory to where the executable is, try
!        * to load library anyway. */
        dll = LoadLibrary(name);
      }
      return dll;
  }
*** ../vim-7.3.700/src/version.c        2012-10-21 02:17:28.000000000 +0200
--- src/version.c       2012-10-21 02:35:48.000000000 +0200
***************
*** 721,722 ****
--- 721,724 ----
  {   /* Add new patch number below this line */
+ /**/
+     701,
  /**/

-- 
BEDEVERE: And that, my lord, is how we know the Earth to be banana-shaped.
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// 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

Raspunde prin e-mail lui