From 8fee878fe277ec1b1b833ba6e5db679151f7982f Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 11 Aug 2015 18:45:48 +0200 Subject: [PATCH] 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) --- src/fileio.c | 2 +- src/version.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/fileio.c b/src/fileio.c index 973e8ca0e..0f3f148b9 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 e3b885ed3..f8ef512dd 100644 --- a/src/version.c +++ b/src/version.c @@ -741,6 +741,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 820, /**/ 819, /**/ -- 2.50.1