aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/option.c
diff options
context:
space:
mode:
authorckelsel <ckelsel@hotmail.com>2017-09-24 10:05:53 +0800
committerckelsel <ckelsel@hotmail.com>2017-09-24 10:17:14 +0800
commit2b53a565b991fc329ab7af683ec50e9cfcac557f (patch)
treeb7c505d7fd20d32727c6c13e7d410935460f546e /src/nvim/option.c
parent4bb0e95abbf0a61d383d5261019a2667706c9d39 (diff)
downloadrneovim-2b53a565b991fc329ab7af683ec50e9cfcac557f.tar.gz
rneovim-2b53a565b991fc329ab7af683ec50e9cfcac557f.tar.bz2
rneovim-2b53a565b991fc329ab7af683ec50e9cfcac557f.zip
vim-patch:8.0.0333
Problem: Illegal memory access when 'complete' ends in a backslash. Solution: Check for trailing backslash. (Dominique Pelle, closes vim/vim#1478) https://github.com/vim/vim/commit/226c53429109f24e31c17016aedfd7fbf7a9aa50
Diffstat (limited to 'src/nvim/option.c')
-rw-r--r--src/nvim/option.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c
index 74250e83e6..13aadb71bb 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -2997,9 +2997,10 @@ did_set_string_option (
if (s[-1] == 'k' || s[-1] == 's') {
/* skip optional filename after 'k' and 's' */
while (*s && *s != ',' && *s != ' ') {
- if (*s == '\\')
- ++s;
- ++s;
+ if (*s == '\\' && s[1] != NUL) {
+ s++;
+ }
+ s++;
}
} else {
if (errbuf != NULL) {