Do not crash when searching for .* with extremely long lines. Reported

by Torbjorn Lonnemark, GitHub issue 3272.
pull/3297/head
nicm 2022-08-03 13:27:48 +00:00
parent 42ba6c1b22
commit c6e7568471
1 changed files with 2 additions and 0 deletions

View File

@ -3673,6 +3673,7 @@ window_copy_search(struct window_mode_entry *wme, int direction, int regex)
if (direction &&
window_copy_search_mark_at(data, fx, fy, &at) == 0 &&
at > 0 &&
data->searchmark != NULL &&
data->searchmark[at] == data->searchmark[at - 1]) {
window_copy_move_after_search_mark(data, &fx, &fy,
wrapflag);
@ -3705,6 +3706,7 @@ window_copy_search(struct window_mode_entry *wme, int direction, int regex)
&start) == 0) {
while (window_copy_search_mark_at(data, fx, fy,
&at) == 0 &&
data->searchmark != NULL &&
data->searchmark[at] ==
data->searchmark[start]) {
data->cx = fx;