Skip to content

Commit 9d32276

Browse files
committed
patch 8.0.1483: searchpair() might return an invalid value on timeout
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)
1 parent 02ae9b4 commit 9d32276

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

src/search.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -973,7 +973,16 @@ searchit(
973973
NULL, NULL
974974
#endif
975975
)) == 0)
976+
{
977+
#ifdef FEAT_RELTIME
978+
/* If the search timed out, we did find a match
979+
* but it might be the wrong one, so that's not
980+
* OK. */
981+
if (timed_out != NULL && *timed_out)
982+
match_ok = FALSE;
983+
#endif
976984
break;
985+
}
977986

978987
/* Need to get the line pointer again, a
979988
* multi-line search may have made it invalid. */

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,8 @@ static char *(features[]) =
771771

772772
static int included_patches[] =
773773
{ /* Add new patch number below this line */
774+
/**/
775+
1483,
774776
/**/
775777
1482,
776778
/**/

0 commit comments

Comments
 (0)