aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/regexp_nfa.c1
-rw-r--r--src/nvim/search.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/src/nvim/regexp_nfa.c b/src/nvim/regexp_nfa.c
index 484dfe1e1f..4cd422400f 100644
--- a/src/nvim/regexp_nfa.c
+++ b/src/nvim/regexp_nfa.c
@@ -4781,6 +4781,7 @@ static long find_match_text(colnr_T startcol, int regstart, char_u *match_text)
if (match
/* check that no composing char follows */
&& !(enc_utf8
+ && STRLEN(regline) > (size_t)(col + len2)
&& utf_iscomposing(PTR2CHAR(regline + col + len2)))
) {
cleanup_subexpr();
diff --git a/src/nvim/search.c b/src/nvim/search.c
index ff5c5f834f..a758e02105 100644
--- a/src/nvim/search.c
+++ b/src/nvim/search.c
@@ -653,7 +653,7 @@ int searchit(
}
if (matchcol == 0 && (options & SEARCH_START))
break;
- if (ptr[matchcol] == NUL
+ if (STRLEN(ptr) <= (size_t)matchcol || ptr[matchcol] == NUL
|| (nmatched = vim_regexec_multi(&regmatch,
win, buf, lnum + matchpos.lnum,
matchcol,