mirror of
https://github.com/neovim/neovim.git
synced 2025-10-03 00:18:33 +00:00
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:

committed by
Justin M. Keyes

parent
2753be6e4d
commit
54973477e7
@@ -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);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -98,7 +98,7 @@ static int included_patches[] = {
|
|||||||
//802,
|
//802,
|
||||||
//801,
|
//801,
|
||||||
//800,
|
//800,
|
||||||
//799,
|
799,
|
||||||
//798,
|
//798,
|
||||||
//797,
|
//797,
|
||||||
//796,
|
//796,
|
||||||
|
Reference in New Issue
Block a user