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
This commit is contained in:
Chiu-Hsiang Hsu
2015-07-31 02:18:18 +08:00
committed by Justin M. Keyes
parent 2753be6e4d
commit 54973477e7
2 changed files with 8 additions and 5 deletions

View File

@@ -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. * Find end of the pattern.
* Watch out for a comma in braces, like "*.\{obj,o\}". * Watch out for a comma in braces, like "*.\{obj,o\}".
*/ */
endpat = pat;
// ignore single comma
if (*endpat == ',') {
continue;
}
brace_level = 0; brace_level = 0;
for (endpat = pat; *endpat && (*endpat != ',' || brace_level for (; *endpat && (*endpat != ',' || brace_level || endpat[-1] == '\\');
|| endpat[-1] == '\\'); ++endpat) { ++endpat) {
if (*endpat == '{') if (*endpat == '{')
brace_level++; brace_level++;
else if (*endpat == '}') else if (*endpat == '}')
brace_level--; brace_level--;
} }
if (pat == endpat) /* ignore single comma */
continue;
patlen = (int)(endpat - pat); patlen = (int)(endpat - pat);
/* /*

View File

@@ -98,7 +98,7 @@ static int included_patches[] = {
//802, //802,
//801, //801,
//800, //800,
//799, 799,
//798, //798,
//797, //797,
//796, //796,