diff src/fileio.c @ 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 dc1b678f0e4e
children beb67ef38f88
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--;