summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <bram@vim.org>2015-08-11 18:45:48 +0200
committerBram Moolenaar <bram@vim.org>2015-08-11 18:45:48 +0200
commita5b59f61644d2ee639977dcaf65eb315b5d6b761 (patch)
treef50726b10fd9da7f434bdd7dcb36b3b7e2db3b19
parent2f26069d1f19fc4e6b4d48025c4899011a51fbdc (diff)
downloadvim-a5b59f61644d2ee639977dcaf65eb315b5d6b761.tar.gz
patch 7.4.820v7.4.820v7-4-820
Problem: Invalid memory access in file_pat_to_reg_pat. Solution: Avoid looking before the start of a string. (Dominique Pelle)
-rw-r--r--src/fileio.c2
-rw-r--r--src/version.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 973e8ca0..0f3f148b 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -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--;
diff --git a/src/version.c b/src/version.c
index e3b885ed..f8ef512d 100644
--- a/src/version.c
+++ b/src/version.c
@@ -742,6 +742,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 820,
+/**/
819,
/**/
818,