vim-patch:7.4.903

Problem:    MS-Windows: When 'encoding' differs from the current code page,
            expandinig wildcards may cause illegal memory access.
Solution:   Allocate a longer buffer. (Ken Takata)

7314efd87d
This commit is contained in:
watiko
2016-02-13 10:52:00 +09:00
parent 6bbd149e98
commit d6c894efaf
2 changed files with 4 additions and 3 deletions

View File

@@ -556,8 +556,9 @@ static size_t do_path_expand(garray_T *gap, const char_u *path,
return 0;
}
/* make room for file name */
buf = xmalloc(STRLEN(path) + BASENAMELEN + 5);
// Make room for file name. When doing encoding conversion the actual
// length may be quite a bit longer, thus use the maximum possible length.
buf = xmalloc(MAXPATHL);
/*
* Find the first part in the path name that contains a wildcard.