aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChiu-Hsiang Hsu <wdv4758h@gmail.com>2015-07-31 02:18:18 +0800
committerJustin M. Keyes <justinkz@gmail.com>2015-08-25 18:43:49 -0400
commit54973477e7a7cc8f955d1755d3243e7f89461e34 (patch)
tree0f5be480de3c06c05ebe5483cd4c0310ad4bb767
parent2753be6e4dee9e697bf5f48329bb1958c9b6d6ab (diff)
downloadrneovim-54973477e7a7cc8f955d1755d3243e7f89461e34.tar.gz
rneovim-54973477e7a7cc8f955d1755d3243e7f89461e34.tar.bz2
rneovim-54973477e7a7cc8f955d1755d3243e7f89461e34.zip
vim-patch:7.4.799
Problem: Accessing memory before an allocated block. Solution: Check for not going before the start of a pattern. (Dominique Pelle) https://github.com/vim/vim/commit/v7-4-799
-rw-r--r--src/nvim/fileio.c11
-rw-r--r--src/nvim/version.c2
2 files changed, 8 insertions, 5 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index 70cdac7947..7689b750c5 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -5749,16 +5749,19 @@ static int do_autocmd_event(event_T event, char_u *pat, int nested, char_u *cmd,
* Find end of the pattern.
* Watch out for a comma in braces, like "*.\{obj,o\}".
*/
+ endpat = pat;
+ // ignore single comma
+ if (*endpat == ',') {
+ continue;
+ }
brace_level = 0;
- for (endpat = pat; *endpat && (*endpat != ',' || brace_level
- || endpat[-1] == '\\'); ++endpat) {
+ for (; *endpat && (*endpat != ',' || brace_level || endpat[-1] == '\\');
+ ++endpat) {
if (*endpat == '{')
brace_level++;
else if (*endpat == '}')
brace_level--;
}
- if (pat == endpat) /* ignore single comma */
- continue;
patlen = (int)(endpat - pat);
/*
diff --git a/src/nvim/version.c b/src/nvim/version.c
index c79c9d0f38..439292d0d6 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -98,7 +98,7 @@ static int included_patches[] = {
//802,
//801,
//800,
- //799,
+ 799,
//798,
//797,
//796,