commit | 8fee878fe277ec1b1b833ba6e5db679151f7982f | [log] [tgz] |
---|---|---|
author | Bram Moolenaar <Bram@vim.org> | Tue Aug 11 18:45:48 2015 +0200 |
committer | Bram Moolenaar <Bram@vim.org> | Tue Aug 11 18:45:48 2015 +0200 |
tree | 8312c60b6eb8d95c1627e20702206dc32f2a54e3 | |
parent | 901e58c243ef4363bb2c13b2c96c7b0acd45e6d1 [diff] [blame] |
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)
diff --git a/src/fileio.c b/src/fileio.c index 973e8ca..0f3f148 100644 --- a/src/fileio.c +++ b/src/fileio.c
@@ -10210,7 +10210,7 @@ else reg_pat[i++] = '^'; endp = pat_end - 1; - if (*endp == '*') + if (endp >= pat && *endp == '*') { while (endp - pat > 0 && *endp == '*') endp--;