summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-02-09 16:04:25 +0100
committerBram Moolenaar <Bram@vim.org>2018-02-09 16:04:25 +0100
commit9d32276b52a63fccfae681f0d1d6ccb66efec1c0 (patch)
tree59241efa93b04e21ca55900de2eeb6c8b5504426
parent02ae9b4a93deea4993d7abe20485f91f1cce5e36 (diff)
downloadvim-git-9d32276b52a63fccfae681f0d1d6ccb66efec1c0.tar.gz
patch 8.0.1483: searchpair() might return an invalid value on timeoutv8.0.1483
Problem: Searchpair() might return an invalid value on timeout. Solution: When the second search times out, do not accept a match from the first search. (Daniel Hahler, closes #2552)
-rw-r--r--src/search.c9
-rw-r--r--src/version.c2
2 files changed, 11 insertions, 0 deletions
diff --git a/src/search.c b/src/search.c
index 42351d5e6..efcf3d96a 100644
--- a/src/search.c
+++ b/src/search.c
@@ -973,7 +973,16 @@ searchit(
NULL, NULL
#endif
)) == 0)
+ {
+#ifdef FEAT_RELTIME
+ /* If the search timed out, we did find a match
+ * but it might be the wrong one, so that's not
+ * OK. */
+ if (timed_out != NULL && *timed_out)
+ match_ok = FALSE;
+#endif
break;
+ }
/* Need to get the line pointer again, a
* multi-line search may have made it invalid. */
diff --git a/src/version.c b/src/version.c
index 528556587..7e07f7735 100644
--- a/src/version.c
+++ b/src/version.c
@@ -772,6 +772,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1483,
+/**/
1482,
/**/
1481,