summaryrefslogtreecommitdiffstats
path: root/window-copy.c
diff options
context:
space:
mode:
authornicm <nicm>2022-08-03 13:27:48 +0000
committernicm <nicm>2022-08-03 13:27:48 +0000
commitc6e7568471f35f7a22e199b444adf17c685e86f3 (patch)
treee373017e7bb325d47b622d462b157c0dcc15e774 /window-copy.c
parent42ba6c1b229c92256274e848e9c5ff1d59d9081b (diff)
Do not crash when searching for .* with extremely long lines. Reported
by Torbjorn Lonnemark, GitHub issue 3272.
Diffstat (limited to 'window-copy.c')
-rw-r--r--window-copy.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/window-copy.c b/window-copy.c
index ab7ed5b1..834a2d99 100644
--- a/window-copy.c
+++ b/window-copy.c
@@ -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;