]> granicus.if.org Git - vim/commitdiff
patch 8.0.1483: searchpair() might return an invalid value on timeout v8.0.1483
authorBram Moolenaar <Bram@vim.org>
Fri, 9 Feb 2018 15:04:25 +0000 (16:04 +0100)
committerBram Moolenaar <Bram@vim.org>
Fri, 9 Feb 2018 15:04:25 +0000 (16:04 +0100)
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)

src/search.c
src/version.c

index 42351d5e63cbed377cf50e0e6be519a5f06583d9..efcf3d96a494c319e0beadc66976af9908db43d6 100644 (file)
@@ -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. */
index 5285565871ebe6f772674bf0a3726167213c582b..7e07f77353de851411f41a7521f2589b1f095ee4 100644 (file)
@@ -771,6 +771,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1483,
 /**/
     1482,
 /**/