summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2015-03-31 14:17:31 +0200
committerBram Moolenaar <Bram@vim.org>2015-03-31 14:17:31 +0200
commit0e462411cafdd908356792b2c229ab6369103bca (patch)
treed99ddbdce3dbeb5860aba70fbcef91fbdb2fc196
parente5c421cfd70a4d864faa0fac4e9f2dd6cdf5881d (diff)
updated for version 7.4.685v7.4.685
Problem: When there are illegal utf-8 characters the old regexp engine may go past the end of a string. Solution: Only advance to the end of the string. (Dominique Pelle)
-rw-r--r--src/regexp.c3
-rw-r--r--src/version.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/src/regexp.c b/src/regexp.c
index bae547cd6a..961796be51 100644
--- a/src/regexp.c
+++ b/src/regexp.c
@@ -4782,7 +4782,8 @@ regmatch(scan)
/* When only a composing char is given match at any
* position where that composing char appears. */
status = RA_NOMATCH;
- for (i = 0; reginput[i] != NUL; i += utf_char2len(inpc))
+ for (i = 0; reginput[i] != NUL;
+ i += utf_ptr2len(reginput + i))
{
inpc = mb_ptr2char(reginput + i);
if (!utf_iscomposing(inpc))
diff --git a/src/version.c b/src/version.c
index f4ed01a647..6156c37319 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 */
/**/
+ 685,
+/**/
684,
/**/
683,