From 53fb7136347b6ebd74c25f4691d9d4d4e94aec60 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 31 Mar 2015 14:17:37 +0200 Subject: [PATCH] updated for version 7.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) --- src/regexp.c | 3 ++- src/version.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) 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 8dfe8f3215..75040ae3c3 100644 --- a/src/version.c +++ b/src/version.c @@ -756,6 +756,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 685, /**/ 684, /**/