diff options
author | Jurica Bradaric <jbradaric@gmail.com> | 2016-01-23 13:53:59 +0100 |
---|---|---|
committer | Jurica Bradaric <jbradaric@gmail.com> | 2016-01-23 13:57:07 +0100 |
commit | f583e512092ecada59f21bc0559b76bcb094b70f (patch) | |
tree | dbb4c8f2ca00a19d49a9b77f8f72eb547c5bfa64 /src/nvim/regexp.c | |
parent | 0ccd1ef725ce4fbe0f86929efad25b24b17c2485 (diff) | |
download | rneovim-f583e512092ecada59f21bc0559b76bcb094b70f.tar.gz rneovim-f583e512092ecada59f21bc0559b76bcb094b70f.tar.bz2 rneovim-f583e512092ecada59f21bc0559b76bcb094b70f.zip |
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
Diffstat (limited to 'src/nvim/regexp.c')
-rw-r--r-- | src/nvim/regexp.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) |