From: Bram Moolenaar Date: Mon, 4 May 2015 08:33:15 +0000 (+0200) Subject: patch 7.4.715 X-Git-Tag: v7.4.715 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2186ffa2c7d8a9e2cb09316a7ac9e4ade3957c2f;p=vim patch 7.4.715 Problem: Invalid memory access when there are illegal bytes. Solution: Get the length from the text, not from the character. (Dominique Pelle) --- diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c index 825f960ca..bb55a7159 100644 --- a/src/regexp_nfa.c +++ b/src/regexp_nfa.c @@ -6602,7 +6602,7 @@ nfa_regmatch(prog, start, submatch, m) /* If ireg_icombine is not set only skip over the character * itself. When it is set skip over composing characters. */ if (result && enc_utf8 && !ireg_icombine) - clen = utf_char2len(curc); + clen = utf_ptr2len(reginput); #endif ADD_STATE_IF_MATCH(t->state); break; diff --git a/src/version.c b/src/version.c index 8f994cd79..7a151bf97 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 */ +/**/ + 715, /**/ 714, /**/