From f583e512092ecada59f21bc0559b76bcb094b70f Mon Sep 17 00:00:00 2001 From: Jurica Bradaric Date: Sat, 23 Jan 2016 13:53:59 +0100 Subject: vim-patch: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) https://github.com/vim/vim/commit/0e462411cafdd908356792b2c229ab6369103bca --- src/nvim/regexp.c | 2 +- src/nvim/version.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c index 39001939d8..e01e812a70 100644 --- a/src/nvim/regexp.c +++ b/src/nvim/regexp.c @@ -4186,7 +4186,7 @@ regmatch ( /* 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)) { if (i > 0) diff --git a/src/nvim/version.c b/src/nvim/version.c index 9b4c191d89..3687087d85 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -439,7 +439,7 @@ static int included_patches[] = { // 688, // 687 NA 686, - // 685, + 685, // 684, // 683 NA 682, -- cgit