0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 7.4.820

Problem:    Invalid memory access in file_pat_to_reg_pat.
Solution:   Avoid looking before the start of a string. (Dominique Pelle)
This commit is contained in:
Bram Moolenaar
2015-08-11 18:45:48 +02:00
parent 901e58c243
commit 8fee878fe2
2 changed files with 3 additions and 1 deletions

View File

@@ -10210,7 +10210,7 @@ file_pat_to_reg_pat(pat, pat_end, allow_dirs, no_bslash)
else
reg_pat[i++] = '^';
endp = pat_end - 1;
if (*endp == '*')
if (endp >= pat && *endp == '*')
{
while (endp - pat > 0 && *endp == '*')
endp--;