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.
* 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);
/*

View File

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