Skip to content

Commit b615c2a

Browse files
committed
updated for version 7.3.373
Problem: A tags file with an extremely long name may cause an infinite loop. Solution: When encountering a long name switch to linear search.
1 parent 8569f3c commit b615c2a

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

src/tag.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1854,7 +1854,7 @@ find_tags(pat, num_matches, matchesp, flags, mincount, buf_ffname)
18541854

18551855
if (state == TS_BINARY && orgpat.regmatch.rm_ic && !sortic)
18561856
{
1857-
/* binary search won't work for ignoring case, use linear
1857+
/* Binary search won't work for ignoring case, use linear
18581858
* search. */
18591859
linear = TRUE;
18601860
state = TS_LINEAR;
@@ -1922,6 +1922,19 @@ find_tags(pat, num_matches, matchesp, flags, mincount, buf_ffname)
19221922
MSG(_("Ignoring long line in tags file"));
19231923
verbose_leave();
19241924
}
1925+
#ifdef FEAT_TAG_BINS
1926+
if (state != TS_LINEAR)
1927+
{
1928+
/* Avoid getting stuck. */
1929+
linear = TRUE;
1930+
state = TS_LINEAR;
1931+
# ifdef HAVE_FSEEKO
1932+
fseeko(fp, search_info.low_offset, SEEK_SET);
1933+
# else
1934+
fseek(fp, (long)search_info.low_offset, SEEK_SET);
1935+
# endif
1936+
}
1937+
#endif
19251938
continue;
19261939
}
19271940

src/version.c

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

715715
static int included_patches[] =
716716
{ /* Add new patch number below this line */
717+
/**/
718+
373,
717719
/**/
718720
372,
719721
/**/

0 commit comments

Comments
 (0)