aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorwatiko <service@mail.watiko.net>2016-02-13 10:52:00 +0900
committerwatiko <service@mail.watiko.net>2016-02-21 22:06:39 +0900
commitd6c894efaf81032753f74b943c138c53e0d1fcaf (patch)
tree7b8103f450441a33975e585367eedb73466a83d7 /src
parent6bbd149e9812161a736863f68400ff394e649b5e (diff)
downloadrneovim-d6c894efaf81032753f74b943c138c53e0d1fcaf.tar.gz
rneovim-d6c894efaf81032753f74b943c138c53e0d1fcaf.tar.bz2
rneovim-d6c894efaf81032753f74b943c138c53e0d1fcaf.zip
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) https://github.com/vim/vim/commit/7314efd87d8c4095229bdc2867a553c36c064918
Diffstat (limited to 'src')
-rw-r--r--src/nvim/path.c5
-rw-r--r--src/nvim/version.c2
2 files changed, 4 insertions, 3 deletions
diff --git a/src/nvim/path.c b/src/nvim/path.c
index 75b34339dd..f22e0af4f3 100644
--- a/src/nvim/path.c
+++ b/src/nvim/path.c
@@ -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.
diff --git a/src/nvim/version.c b/src/nvim/version.c
index a3ada277b7..fbace9ec93 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -387,7 +387,7 @@ static int included_patches[] = {
// 906 NA
// 905,
// 904,
- // 903,
+ 903,
// 902 NA
// 901,
// 900 NA