changeset 7005:bb44542231dc v7.4.820

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)
author Bram Moolenaar <bram@vim.org>
date Tue, 11 Aug 2015 18:45:48 +0200
parents 19e7e0fce7a5
children 1520ad7bad2f
files src/fileio.c src/version.c
diffstat 2 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -10210,7 +10210,7 @@ file_pat_to_reg_pat(pat, pat_end, allow_
     else
 	reg_pat[i++] = '^';
     endp = pat_end - 1;
-    if (*endp == '*')
+    if (endp >= pat && *endp == '*')
     {
 	while (endp - pat > 0 && *endp == '*')
 	    endp--;
--- 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,