Merge pull request #7993 from blueyed/vim-8.0.1483

vim-patch:8.0.1483: searchpair() might return an invalid value on timeout
This commit is contained in:
Justin M. Keyes 2018-02-10 23:18:04 +01:00 committed by GitHub
commit c205360f00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -775,12 +775,17 @@ int searchit(
}
}
if (ptr[matchcol] == NUL
|| (nmatched = vim_regexec_multi(&regmatch,
win, buf, lnum + matchpos.lnum,
matchcol,
tm
)) == 0)
break;
|| (nmatched = vim_regexec_multi(
&regmatch, win, buf, lnum + matchpos.lnum, matchcol,
tm)) == 0) {
// If the search timed out, we did find a match
// but it might be the wrong one, so that's not
// OK.
if (tm != NULL && profile_passed_limit(*tm)) {
match_ok = false;
}
break;
}
/* Need to get the line pointer again, a
* multi-line search may have made it invalid. */