Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

updated for version 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)
  • Loading branch information...
commit 0fa7326ee9daadf7c710a5f5de758c58688ccc13 1 parent ffb1760
Bram Moolenaar authored
Showing with 14 additions and 4 deletions.
  1. +12 −4 src/os_win32.c
  2. +2 −0  src/version.c
View
16 src/os_win32.c
@@ -288,18 +288,26 @@ unescape_shellxquote(char_u *p, char_u *escaped)
vimLoadLib(char *name)
{
HINSTANCE dll = NULL;
- char old_dir[MAXPATHL];
+ 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 && mch_dirname(old_dir, MAXPATHL) == OK)
+ 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. */
- mch_chdir(exe_path);
+ 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);
- mch_chdir(old_dir);
}
return dll;
}
View
2  src/version.c
@@ -720,6 +720,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 701,
+/**/
700,
/**/
699,
Please sign in to comment.
Something went wrong with that request. Please try again.